variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
items (alias: lne)(amount, name, value, status)
orders(type, id, salary, level)
Task: Retrieve amount from items with value above the AVG(value) of orders rows sharing the same type.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.type = lne.type
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01200 | train |
v2 | Schema:
sales (alias: sale)(code, amount, value, type)
transactions(level, name, id, amount)
Task: Retrieve code from sales that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01201 | train |
v3 | Schema:
staff (alias: empl)(amount, salary, code, name)
departments(status, code, level, type)
Task: Retrieve salary from staff with salary above the MIN(value) of departments rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01202 | train |
v2 | Schema:
staff (alias: empl)(level, date, value, id)
requests(value, id, level, salary)
Task: Retrieve salary from staff that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01203 | train |
v2 | Schema:
categories (alias: catg)(type, status, date, id)
items(level, date, salary, id)
Task: Find code from categories where a matching record exists in items with the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01204 | train |
v2 | Schema:
managers (alias: mgr)(amount, code, level, salary)
regions(salary, level, type, id)
Task: Find salary from managers where a matching record exists in regions with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01205 | train |
v3 | Schema:
shipments (alias: shp)(id, level, salary, type)
accounts(value, level, name, status)
Task: Retrieve name from shipments with value above the MAX(value) of accounts rows sharing the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01206 | train |
v2 | Schema:
employees (alias: emp)(id, level, type, value)
staff(salary, status, id, name)
Task: Retrieve id from employees that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01207 | train |
v3 | Schema:
categories (alias: catg)(name, id, date, salary)
products(level, name, amount, type)
Task: Find name from categories where amount exceeds the maximum value from products for the same id.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT MAX(value) FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01208 | train |
v2 | Schema:
products (alias: prod)(name, salary, status, type)
accounts(code, salary, amount, id)
Task: Find salary from products where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = prod.type
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01209 | train |
v1 | Schema:
staff (alias: empl)(type, salary, code, level)
accounts(level, type, salary, id)
Task: Select value from staff where code exists in accounts for the same status.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01210 | train |
v1 | Schema:
employees (alias: emp)(code, status, id, date)
staff(name, amount, code, type)
Task: Select value from employees where code exists in staff for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01211 | train |
v3 | Schema:
tasks (alias: tsk)(status, type, id, amount)
products(level, amount, name, code)
Task: Find id from tasks where amount exceeds the minimum amount from products for the same level.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01212 | train |
v1 | Schema:
transactions (alias: txn)(salary, status, id, amount)
categories(value, type, name, level)
Task: Select name from transactions where code exists in categories for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01213 | train |
v1 | Schema:
requests (alias: ordr)(value, code, date, amount)
projects(amount, level, id, value)
Task: Select value from requests where id exists in projects for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01214 | train |
v2 | Schema:
items (alias: lne)(salary, type, id, value)
invoices(amount, name, status, salary)
Task: Find name from items where a matching record exists in invoices with the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01215 | train |
v2 | Schema:
employees (alias: emp)(date, id, code, name)
shipments(amount, type, id, level)
Task: Retrieve salary from employees that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01216 | train |
v1 | Schema:
orders (alias: ord)(amount, type, salary, code)
sales(value, date, salary, level)
Task: Find salary from orders where type appears in sales entries with matching code.
SQL: | SELECT salary FROM orders AS ord
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01217 | train |
v1 | Schema:
shipments (alias: shp)(id, code, type, name)
tasks(status, id, amount, salary)
Task: Retrieve id from shipments whose level is found in tasks rows where code matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01218 | train |
v1 | Schema:
managers (alias: mgr)(code, name, type, salary)
schedules(code, level, id, status)
Task: Find value from managers where type appears in schedules entries with matching level.
SQL: | SELECT value FROM managers AS mgr
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01219 | train |
v2 | Schema:
items (alias: lne)(code, amount, salary, status)
orders(id, type, code, level)
Task: Retrieve value from items that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = lne.type
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01220 | train |
v1 | Schema:
requests (alias: ordr)(amount, type, id, name)
shipments(amount, code, status, value)
Task: Find code from requests where level appears in shipments entries with matching id.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01221 | train |
v1 | Schema:
customers (alias: cust)(name, type, amount, code)
staff(salary, status, id, level)
Task: Select name from customers where level exists in staff for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01222 | train |
v2 | Schema:
staff (alias: empl)(level, value, salary, id)
regions(date, salary, type, id)
Task: Find amount from staff where a matching record exists in regions with the same status.
SQL: | SELECT amount 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": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01223 | train |
v1 | Schema:
categories (alias: catg)(name, id, value, type)
shipments(status, level, name, id)
Task: Retrieve amount from categories whose level is found in shipments rows where type matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01224 | train |
v1 | Schema:
schedules (alias: schd)(level, name, amount, date)
accounts(type, salary, level, amount)
Task: Select id from schedules where status exists in accounts for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01225 | train |
v3 | Schema:
customers (alias: cust)(name, type, id, date)
products(name, code, salary, level)
Task: Retrieve id from customers with amount above the MIN(salary) of products rows sharing the same id.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01226 | train |
v2 | Schema:
employees (alias: emp)(value, name, level, type)
accounts(value, name, type, status)
Task: Find id from employees where a matching record exists in accounts with the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01227 | train |
v2 | Schema:
requests (alias: ordr)(name, date, id, salary)
items(amount, date, value, status)
Task: Retrieve salary from requests that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT salary 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": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01228 | train |
v1 | Schema:
shipments (alias: shp)(value, level, date, code)
departments(id, status, code, salary)
Task: Select value from shipments where level exists in departments for the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01229 | train |
v2 | Schema:
employees (alias: emp)(status, amount, code, salary)
accounts(date, status, level, type)
Task: Retrieve code from employees that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01230 | train |
v1 | Schema:
branches (alias: brc)(amount, value, date, code)
orders(date, salary, name, id)
Task: Retrieve amount from branches whose type is found in orders rows where id matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01231 | train |
v2 | Schema:
managers (alias: mgr)(date, amount, salary, name)
sales(code, type, level, name)
Task: Retrieve code from managers that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01232 | train |
v2 | Schema:
managers (alias: mgr)(status, type, code, name)
tasks(status, type, code, salary)
Task: Retrieve id from managers that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01233 | train |
v3 | Schema:
employees (alias: emp)(type, code, salary, name)
products(type, level, name, value)
Task: Retrieve name from employees with amount above the MIN(salary) of products rows sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01234 | train |
v3 | Schema:
staff (alias: empl)(type, value, id, salary)
products(id, level, date, type)
Task: Retrieve name from staff with amount above the MIN(value) of products rows sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM products AS prod
WHERE prod.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01235 | train |
v1 | Schema:
staff (alias: empl)(status, date, salary, code)
products(date, amount, id, level)
Task: Retrieve salary from staff whose code is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01236 | train |
v2 | Schema:
categories (alias: catg)(id, salary, date, code)
invoices(status, level, value, type)
Task: Retrieve value from categories that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01237 | train |
v1 | Schema:
employees (alias: emp)(salary, amount, type, value)
invoices(name, value, date, status)
Task: Select amount from employees where status exists in invoices for the same level.
SQL: | SELECT amount 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": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01238 | train |
v2 | Schema:
managers (alias: mgr)(date, status, id, salary)
shipments(code, status, amount, type)
Task: Find name from managers where a matching record exists in shipments with the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01239 | train |
v1 | Schema:
requests (alias: ordr)(name, id, value, date)
categories(code, salary, amount, name)
Task: Retrieve code from requests whose level is found in categories rows where code matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01240 | train |
v1 | Schema:
requests (alias: ordr)(id, name, amount, code)
regions(date, status, name, id)
Task: Select code from requests where status exists in regions for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01241 | train |
v2 | Schema:
staff (alias: empl)(salary, status, code, amount)
accounts(status, level, code, value)
Task: Retrieve name from staff that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01242 | train |
v2 | Schema:
products (alias: prod)(value, amount, date, salary)
categories(status, value, level, date)
Task: Retrieve amount from products that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = prod.status
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01243 | train |
v3 | Schema:
customers (alias: cust)(value, salary, name, code)
products(salary, amount, value, date)
Task: Find name from customers where value exceeds the minimum amount from products for the same level.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01244 | train |
v3 | Schema:
sales (alias: sale)(status, name, amount, type)
orders(level, code, value, salary)
Task: Retrieve amount from sales with value above the AVG(salary) of orders rows sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01245 | train |
v1 | Schema:
invoices (alias: inv)(status, id, date, salary)
branches(salary, type, amount, name)
Task: Select amount from invoices where status exists in branches for the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01246 | train |
v1 | Schema:
shipments (alias: shp)(id, name, date, type)
customers(amount, salary, date, id)
Task: Select code from shipments where status exists in customers for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01247 | train |
v1 | Schema:
items (alias: lne)(id, name, type, salary)
categories(salary, date, amount, name)
Task: Find name from items where code appears in categories entries with matching status.
SQL: | SELECT name FROM items AS lne
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01248 | train |
v2 | Schema:
items (alias: lne)(id, date, name, amount)
branches(value, date, level, type)
Task: Find salary from items where a matching record exists in branches with the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = lne.status
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01249 | train |
v1 | Schema:
orders (alias: ord)(status, salary, code, date)
employees(type, id, date, name)
Task: Find code from orders where type appears in employees entries with matching id.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01250 | train |
v2 | Schema:
regions (alias: rgn)(name, value, id, date)
branches(level, name, type, status)
Task: Find name from regions where a matching record exists in branches with the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01251 | train |
v1 | Schema:
items (alias: lne)(amount, code, level, name)
schedules(status, date, salary, value)
Task: Find id from items where status appears in schedules entries with matching level.
SQL: | SELECT id FROM items AS lne
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = lne.level
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01252 | train |
v2 | Schema:
departments (alias: dept)(amount, salary, level, value)
customers(id, salary, status, value)
Task: Retrieve salary from departments that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01253 | train |
v3 | Schema:
items (alias: lne)(code, type, name, date)
regions(id, code, value, name)
Task: Retrieve value from items with value above the MIN(value) of regions rows sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01254 | train |
v3 | Schema:
products (alias: prod)(id, status, amount, level)
staff(level, code, name, status)
Task: Retrieve salary from products with amount above the AVG(salary) of staff rows sharing the same type.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.type = prod.type
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01255 | train |
v3 | Schema:
transactions (alias: txn)(value, status, type, amount)
accounts(amount, code, salary, id)
Task: Find value from transactions where salary exceeds the average amount from accounts for the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01256 | train |
v2 | Schema:
projects (alias: prj)(value, type, salary, id)
managers(status, id, amount, salary)
Task: Find salary from projects where a matching record exists in managers with the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01257 | train |
v1 | Schema:
staff (alias: empl)(status, code, value, id)
tasks(code, status, id, name)
Task: Retrieve name from staff whose id is found in tasks rows where status matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01258 | train |
v2 | Schema:
departments (alias: dept)(amount, level, code, salary)
managers(code, name, status, value)
Task: Retrieve code from departments that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01259 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, date, level)
orders(type, id, amount, name)
Task: Retrieve value from schedules whose level is found in orders rows where level matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01260 | train |
v3 | Schema:
departments (alias: dept)(type, name, amount, status)
requests(type, name, date, amount)
Task: Find name from departments where amount exceeds the average amount from requests for the same id.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01261 | train |
v2 | Schema:
invoices (alias: inv)(name, type, id, status)
managers(date, amount, value, code)
Task: Retrieve name from invoices that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01262 | train |
v1 | Schema:
shipments (alias: shp)(salary, code, level, id)
requests(id, value, salary, level)
Task: Select name from shipments where code exists in requests for the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01263 | train |
v1 | Schema:
requests (alias: ordr)(id, level, salary, name)
schedules(code, value, status, date)
Task: Find name from requests where status appears in schedules entries with matching code.
SQL: | SELECT name FROM requests AS ordr
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01264 | train |
v2 | Schema:
requests (alias: ordr)(status, level, value, amount)
items(id, amount, name, type)
Task: Retrieve amount from requests that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01265 | train |
v2 | Schema:
accounts (alias: acct)(level, value, status, date)
orders(status, salary, id, value)
Task: Retrieve code from accounts that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01266 | train |
v1 | Schema:
branches (alias: brc)(status, salary, amount, type)
requests(status, salary, name, id)
Task: Retrieve salary from branches whose id is found in requests rows where status matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01267 | train |
v3 | Schema:
transactions (alias: txn)(status, code, type, salary)
departments(amount, level, id, date)
Task: Retrieve name from transactions with value above the COUNT(value) of departments rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01268 | train |
v3 | Schema:
projects (alias: prj)(name, code, date, status)
managers(amount, value, salary, level)
Task: Find salary from projects where salary exceeds the count of amount from managers for the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01269 | train |
v2 | Schema:
products (alias: prod)(code, type, id, status)
items(level, type, id, date)
Task: Find amount from products where a matching record exists in items with the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01270 | train |
v1 | Schema:
employees (alias: emp)(value, salary, amount, id)
shipments(value, status, name, amount)
Task: Find amount from employees where id appears in shipments entries with matching level.
SQL: | SELECT amount FROM employees AS emp
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01271 | train |
v2 | Schema:
invoices (alias: inv)(code, value, name, salary)
products(code, date, value, id)
Task: Find salary from invoices where a matching record exists in products with the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01272 | train |
v3 | Schema:
transactions (alias: txn)(date, id, code, type)
orders(value, salary, status, id)
Task: Retrieve salary from transactions with salary above the MIN(salary) of orders rows sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01273 | train |
v1 | Schema:
managers (alias: mgr)(name, salary, code, type)
staff(status, date, name, salary)
Task: Select amount from managers where level exists in staff for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01274 | train |
v3 | Schema:
invoices (alias: inv)(id, status, type, name)
products(value, date, code, amount)
Task: Retrieve value from invoices with amount above the MAX(salary) of products rows sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01275 | train |
v1 | Schema:
projects (alias: prj)(amount, level, code, date)
requests(status, date, salary, amount)
Task: Select amount from projects where type exists in requests for the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01276 | train |
v3 | Schema:
projects (alias: prj)(amount, salary, status, date)
accounts(level, code, name, id)
Task: Find code from projects where value exceeds the count of salary from accounts for the same type.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01277 | train |
v2 | Schema:
requests (alias: ordr)(level, name, type, id)
departments(date, level, code, name)
Task: Find amount from requests where a matching record exists in departments with the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01278 | train |
v2 | Schema:
transactions (alias: txn)(id, amount, name, status)
sales(code, name, date, level)
Task: Find amount from transactions where a matching record exists in sales with the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01279 | train |
v1 | Schema:
departments (alias: dept)(level, code, id, date)
shipments(amount, salary, name, level)
Task: Select name from departments where status exists in shipments for the same code.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01280 | train |
v3 | Schema:
accounts (alias: acct)(date, name, status, type)
customers(id, name, amount, date)
Task: Find salary from accounts where salary exceeds the total value from customers for the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01281 | train |
v1 | Schema:
projects (alias: prj)(id, amount, salary, level)
managers(amount, type, value, id)
Task: Find id from projects where code appears in managers entries with matching type.
SQL: | SELECT id FROM projects AS prj
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01282 | train |
v1 | Schema:
transactions (alias: txn)(salary, status, type, id)
staff(status, value, id, amount)
Task: Find amount from transactions where level appears in staff entries with matching status.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01283 | train |
v1 | Schema:
staff (alias: empl)(type, date, amount, salary)
invoices(status, id, code, type)
Task: Select code from staff where type exists in invoices for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01284 | train |
v2 | Schema:
invoices (alias: inv)(status, level, name, id)
orders(salary, date, level, value)
Task: Find id from invoices where a matching record exists in orders with the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01285 | train |
v2 | Schema:
categories (alias: catg)(name, id, code, amount)
shipments(date, code, value, salary)
Task: Retrieve id from categories that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01286 | train |
v1 | Schema:
departments (alias: dept)(level, value, id, code)
shipments(name, date, amount, status)
Task: Select name from departments where level exists in shipments for the same type.
SQL: | SELECT name FROM departments AS dept
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01287 | train |
v2 | Schema:
regions (alias: rgn)(salary, id, level, type)
shipments(type, code, amount, date)
Task: Retrieve name from regions that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01288 | train |
v3 | Schema:
regions (alias: rgn)(name, type, id, level)
shipments(name, type, salary, amount)
Task: Retrieve amount from regions with amount above the MAX(amount) of shipments rows sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01289 | train |
v3 | Schema:
tasks (alias: tsk)(status, code, salary, type)
transactions(level, salary, name, code)
Task: Find name from tasks where salary exceeds the average amount from transactions for the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01290 | train |
v1 | Schema:
customers (alias: cust)(code, status, type, date)
regions(code, amount, date, value)
Task: Select id from customers where status exists in regions for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01291 | train |
v1 | Schema:
products (alias: prod)(salary, level, amount, date)
employees(status, level, name, value)
Task: Find value from products where level appears in employees entries with matching id.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01292 | train |
v2 | Schema:
invoices (alias: inv)(id, code, amount, level)
items(id, type, date, status)
Task: Find name from invoices where a matching record exists in items with the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01293 | train |
v3 | Schema:
shipments (alias: shp)(id, type, status, amount)
regions(level, status, amount, date)
Task: Retrieve id from shipments with salary above the AVG(amount) of regions rows sharing the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01294 | train |
v2 | Schema:
tasks (alias: tsk)(status, id, name, amount)
requests(level, code, id, status)
Task: Retrieve code from tasks that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01295 | train |
v2 | Schema:
customers (alias: cust)(status, code, name, id)
invoices(type, level, value, name)
Task: Find amount from customers where a matching record exists in invoices with the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01296 | train |
v3 | Schema:
projects (alias: prj)(name, status, id, date)
regions(date, salary, code, type)
Task: Find name from projects where value exceeds the average salary from regions for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01297 | train |
v2 | Schema:
products (alias: prod)(date, level, amount, code)
projects(name, amount, id, code)
Task: Find code from products where a matching record exists in projects with the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = prod.id
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01298 | train |
v1 | Schema:
accounts (alias: acct)(amount, name, level, id)
categories(level, date, id, value)
Task: Select value from accounts where status exists in categories for the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01299 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.