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 |
|---|---|---|---|---|---|---|
v2 | Schema:
branches (alias: brc)(id, status, value, code)
categories(name, salary, level, id)
Task: Retrieve amount from branches that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14400 | train |
v1 | Schema:
managers (alias: mgr)(code, salary, value, status)
regions(code, name, type, id)
Task: Select salary from managers where type exists in regions for the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14401 | train |
v2 | Schema:
departments (alias: dept)(status, amount, id, date)
schedules(status, amount, code, date)
Task: Retrieve name from departments that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14402 | train |
v2 | Schema:
staff (alias: empl)(code, value, amount, level)
orders(name, code, id, value)
Task: Retrieve amount from staff that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14403 | train |
v1 | Schema:
managers (alias: mgr)(type, code, amount, status)
customers(status, salary, id, code)
Task: Find id from managers where status appears in customers entries with matching status.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14404 | train |
v2 | Schema:
regions (alias: rgn)(level, amount, type, date)
categories(status, type, level, amount)
Task: Retrieve value from regions that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14405 | train |
v1 | Schema:
items (alias: lne)(salary, date, id, code)
requests(salary, level, amount, type)
Task: Select salary from items where id exists in requests for the same type.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14406 | train |
v2 | Schema:
managers (alias: mgr)(type, value, level, date)
requests(status, id, name, code)
Task: Retrieve name from managers that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14407 | train |
v1 | Schema:
tasks (alias: tsk)(salary, date, id, value)
items(id, date, type, value)
Task: Select name from tasks where level exists in items for the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14408 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, type, name)
requests(salary, date, type, id)
Task: Find salary from shipments where a matching record exists in requests with the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14409 | train |
v1 | Schema:
sales (alias: sale)(type, amount, value, status)
invoices(salary, name, type, status)
Task: Retrieve amount from sales whose status is found in invoices rows where type matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14410 | train |
v1 | Schema:
tasks (alias: tsk)(id, type, code, amount)
branches(salary, value, code, amount)
Task: Find code from tasks where level appears in branches entries with matching level.
SQL: | SELECT code FROM tasks AS tsk
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14411 | train |
v3 | Schema:
regions (alias: rgn)(value, name, type, salary)
transactions(value, id, date, level)
Task: Find amount from regions where value exceeds the average amount from transactions for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14412 | train |
v3 | Schema:
categories (alias: catg)(amount, id, value, level)
accounts(value, date, salary, amount)
Task: Retrieve id from categories with salary above the MAX(value) of accounts rows sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14413 | train |
v1 | Schema:
branches (alias: brc)(level, type, value, amount)
customers(amount, code, date, level)
Task: Find value from branches where id appears in customers entries with matching status.
SQL: | SELECT value FROM branches AS brc
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14414 | train |
v3 | Schema:
staff (alias: empl)(amount, salary, id, name)
shipments(level, value, name, type)
Task: Retrieve salary from staff with value above the SUM(value) of shipments rows sharing the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14415 | train |
v3 | Schema:
staff (alias: empl)(date, level, type, id)
branches(level, salary, value, type)
Task: Retrieve salary from staff with value above the MIN(amount) of branches rows sharing the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14416 | train |
v3 | Schema:
tasks (alias: tsk)(date, salary, status, amount)
staff(code, type, value, amount)
Task: Find amount from tasks where amount exceeds the minimum salary from staff for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14417 | train |
v1 | Schema:
requests (alias: ordr)(name, level, amount, id)
projects(amount, status, id, salary)
Task: Select amount from requests where level exists in projects for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14418 | train |
v1 | Schema:
projects (alias: prj)(status, type, code, id)
orders(type, id, value, date)
Task: Select salary from projects where code exists in orders for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14419 | train |
v1 | Schema:
requests (alias: ordr)(id, name, type, code)
departments(salary, name, date, amount)
Task: Find id from requests where id appears in departments entries with matching status.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14420 | train |
v3 | Schema:
projects (alias: prj)(level, name, type, salary)
branches(salary, type, status, date)
Task: Find salary from projects where salary exceeds the average value from branches for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14421 | train |
v3 | Schema:
projects (alias: prj)(type, value, level, id)
orders(amount, code, date, name)
Task: Find amount from projects where value exceeds the maximum amount from orders for the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14422 | train |
v2 | Schema:
schedules (alias: schd)(salary, value, level, amount)
categories(value, amount, level, type)
Task: Find code from schedules where a matching record exists in categories with the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14423 | train |
v3 | Schema:
projects (alias: prj)(salary, code, date, id)
regions(value, date, level, status)
Task: Find value from projects where salary exceeds the average amount from regions for the same type.
SQL: | SELECT value FROM projects AS prj
WHERE salary > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14424 | train |
v2 | Schema:
schedules (alias: schd)(id, salary, code, date)
tasks(level, amount, code, id)
Task: Retrieve salary from schedules that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14425 | train |
v2 | Schema:
managers (alias: mgr)(salary, type, status, code)
departments(date, salary, level, status)
Task: Retrieve id from managers that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14426 | train |
v1 | Schema:
orders (alias: ord)(name, amount, level, code)
branches(status, level, amount, id)
Task: Find id from orders where type appears in branches entries with matching status.
SQL: | SELECT id FROM orders AS ord
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14427 | train |
v1 | Schema:
categories (alias: catg)(level, status, value, id)
requests(date, code, id, amount)
Task: Find name from categories where code appears in requests entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14428 | train |
v3 | Schema:
shipments (alias: shp)(amount, code, status, type)
requests(status, value, level, type)
Task: Retrieve value from shipments with amount above the AVG(salary) of requests rows sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14429 | train |
v2 | Schema:
categories (alias: catg)(date, id, code, type)
staff(date, salary, status, value)
Task: Find salary from categories where a matching record exists in staff with the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14430 | train |
v2 | Schema:
sales (alias: sale)(name, status, amount, date)
projects(code, name, value, status)
Task: Find amount from sales where a matching record exists in projects with the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14431 | train |
v2 | Schema:
products (alias: prod)(value, code, type, level)
sales(type, value, salary, id)
Task: Retrieve amount from products that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = prod.type
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14432 | train |
v3 | Schema:
branches (alias: brc)(type, date, status, amount)
staff(salary, date, name, amount)
Task: Find name from branches where value exceeds the maximum amount from staff for the same level.
SQL: | SELECT name FROM branches AS brc
WHERE value > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14433 | train |
v3 | Schema:
staff (alias: empl)(value, id, amount, level)
items(date, type, id, level)
Task: Retrieve value from staff with value above the AVG(salary) of items rows sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM items AS lne
WHERE lne.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14434 | train |
v1 | Schema:
departments (alias: dept)(value, type, date, status)
sales(date, code, salary, id)
Task: Select value from departments where id exists in sales for the same level.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14435 | train |
v1 | Schema:
requests (alias: ordr)(name, id, amount, salary)
accounts(date, status, value, amount)
Task: Retrieve id from requests whose level is found in accounts rows where id matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14436 | train |
v3 | Schema:
categories (alias: catg)(status, value, date, amount)
invoices(amount, status, name, value)
Task: Find amount from categories where salary exceeds the maximum amount from invoices for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14437 | train |
v3 | Schema:
employees (alias: emp)(date, type, code, amount)
customers(status, name, salary, amount)
Task: Retrieve id from employees with salary above the COUNT(amount) of customers rows sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14438 | train |
v2 | Schema:
branches (alias: brc)(level, salary, status, amount)
invoices(amount, date, name, level)
Task: Find name from branches where a matching record exists in invoices with the same type.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14439 | train |
v3 | Schema:
branches (alias: brc)(level, value, amount, salary)
accounts(amount, id, name, salary)
Task: Retrieve value from branches with value above the AVG(amount) of accounts rows sharing the same id.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14440 | train |
v3 | Schema:
orders (alias: ord)(salary, date, status, amount)
projects(salary, amount, type, level)
Task: Retrieve amount from orders with value above the MAX(amount) of projects rows sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14441 | train |
v3 | Schema:
branches (alias: brc)(code, value, date, status)
employees(status, date, value, type)
Task: Find amount from branches where value exceeds the total salary from employees for the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14442 | train |
v3 | Schema:
shipments (alias: shp)(date, value, salary, id)
products(code, salary, status, date)
Task: Find code from shipments where value exceeds the minimum amount from products for the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14443 | train |
v2 | Schema:
items (alias: lne)(value, code, date, type)
regions(code, salary, date, id)
Task: Retrieve value from items that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14444 | train |
v1 | Schema:
staff (alias: empl)(status, type, id, amount)
sales(status, salary, value, code)
Task: Select code from staff where status exists in sales for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14445 | train |
v3 | Schema:
accounts (alias: acct)(type, code, id, status)
invoices(level, salary, date, name)
Task: Retrieve code from accounts with value above the MIN(amount) of invoices rows sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14446 | train |
v1 | Schema:
requests (alias: ordr)(status, id, type, code)
accounts(code, status, date, id)
Task: Select salary from requests where id exists in accounts for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14447 | train |
v2 | Schema:
shipments (alias: shp)(value, date, status, type)
tasks(name, amount, level, salary)
Task: Retrieve amount from shipments that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14448 | train |
v2 | Schema:
sales (alias: sale)(name, value, id, salary)
requests(amount, status, salary, id)
Task: Find amount from sales where a matching record exists in requests with the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14449 | train |
v1 | Schema:
branches (alias: brc)(date, code, name, amount)
customers(salary, code, type, date)
Task: Retrieve name from branches whose status is found in customers rows where type matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14450 | train |
v2 | Schema:
schedules (alias: schd)(level, type, salary, id)
sales(status, level, salary, amount)
Task: Find value from schedules where a matching record exists in sales with the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14451 | train |
v2 | Schema:
requests (alias: ordr)(value, id, type, code)
accounts(salary, amount, value, name)
Task: Retrieve value from requests that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14452 | train |
v3 | Schema:
projects (alias: prj)(amount, type, level, salary)
invoices(value, type, status, amount)
Task: Find name from projects where salary exceeds the total salary from invoices for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14453 | train |
v2 | Schema:
sales (alias: sale)(level, salary, type, code)
managers(amount, level, status, code)
Task: Retrieve id from sales that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14454 | train |
v2 | Schema:
regions (alias: rgn)(code, type, amount, level)
orders(id, status, code, date)
Task: Find name from regions where a matching record exists in orders with the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14455 | train |
v1 | Schema:
categories (alias: catg)(value, name, level, code)
transactions(amount, date, salary, name)
Task: Find name from categories where id appears in transactions entries with matching code.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14456 | train |
v3 | Schema:
projects (alias: prj)(type, id, date, name)
departments(type, value, level, salary)
Task: Retrieve name from projects with value above the MIN(salary) of departments rows sharing the same status.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14457 | train |
v2 | Schema:
tasks (alias: tsk)(status, date, salary, name)
projects(amount, code, value, id)
Task: Retrieve value from tasks that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14458 | train |
v3 | Schema:
invoices (alias: inv)(status, level, type, value)
staff(status, date, code, name)
Task: Find id from invoices where amount exceeds the average amount from staff for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14459 | train |
v3 | Schema:
departments (alias: dept)(name, id, amount, status)
regions(salary, level, date, type)
Task: Retrieve name from departments with salary above the MIN(salary) of regions rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14460 | train |
v3 | Schema:
items (alias: lne)(value, name, id, amount)
employees(level, name, code, salary)
Task: Find name from items where value exceeds the average amount from employees for the same level.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14461 | train |
v1 | Schema:
customers (alias: cust)(value, salary, status, date)
shipments(name, id, level, value)
Task: Find salary from customers where type appears in shipments entries with matching code.
SQL: | SELECT salary FROM customers AS cust
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14462 | train |
v2 | Schema:
employees (alias: emp)(amount, type, salary, code)
requests(name, date, id, level)
Task: Find name from employees where a matching record exists in requests with the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14463 | train |
v1 | Schema:
sales (alias: sale)(level, status, code, type)
categories(amount, salary, value, status)
Task: Retrieve id from sales whose id is found in categories rows where type matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14464 | train |
v3 | Schema:
regions (alias: rgn)(salary, name, id, value)
customers(name, amount, value, type)
Task: Retrieve name from regions with amount above the COUNT(amount) of customers rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14465 | train |
v2 | Schema:
managers (alias: mgr)(value, id, type, salary)
requests(status, amount, date, value)
Task: Find name from managers where a matching record exists in requests with the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14466 | train |
v2 | Schema:
requests (alias: ordr)(code, date, name, salary)
departments(name, type, date, value)
Task: Retrieve id from requests that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14467 | train |
v2 | Schema:
items (alias: lne)(status, salary, id, date)
customers(id, level, value, status)
Task: Find amount from items where a matching record exists in customers with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = lne.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14468 | train |
v3 | Schema:
branches (alias: brc)(code, salary, value, id)
managers(date, salary, status, amount)
Task: Retrieve amount from branches with amount above the AVG(salary) of managers rows sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14469 | train |
v2 | Schema:
shipments (alias: shp)(id, name, type, code)
invoices(name, type, status, code)
Task: Retrieve salary from shipments that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14470 | train |
v3 | Schema:
staff (alias: empl)(value, type, name, level)
tasks(type, value, level, code)
Task: Retrieve amount from staff with salary above the AVG(value) of tasks rows sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14471 | train |
v2 | Schema:
transactions (alias: txn)(date, name, amount, id)
sales(value, id, code, level)
Task: Retrieve code from transactions that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14472 | train |
v1 | Schema:
orders (alias: ord)(status, amount, value, code)
items(value, id, amount, status)
Task: Find code from orders where type appears in items entries with matching code.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14473 | train |
v2 | Schema:
branches (alias: brc)(status, salary, level, type)
managers(salary, amount, date, id)
Task: Retrieve amount from branches that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14474 | train |
v3 | Schema:
orders (alias: ord)(salary, value, amount, id)
products(amount, type, date, status)
Task: Find salary from orders where salary exceeds the count of value from products for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14475 | train |
v1 | Schema:
requests (alias: ordr)(value, id, date, name)
invoices(status, level, name, type)
Task: Retrieve code from requests whose level is found in invoices rows where id matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14476 | train |
v2 | Schema:
items (alias: lne)(amount, value, level, date)
employees(value, date, status, name)
Task: Retrieve value from items that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14477 | train |
v3 | Schema:
regions (alias: rgn)(name, amount, salary, value)
employees(amount, id, date, value)
Task: Find amount from regions where amount exceeds the minimum value from employees for the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14478 | train |
v2 | Schema:
orders (alias: ord)(amount, id, date, salary)
departments(amount, status, code, level)
Task: Retrieve code from orders that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14479 | train |
v2 | Schema:
managers (alias: mgr)(value, status, code, level)
accounts(type, level, name, date)
Task: Retrieve code from managers that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14480 | train |
v3 | Schema:
employees (alias: emp)(value, code, salary, status)
products(id, salary, status, amount)
Task: Find salary from employees where amount exceeds the count of value from products for the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14481 | train |
v2 | Schema:
branches (alias: brc)(salary, type, name, date)
sales(name, id, status, value)
Task: Retrieve id from branches that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14482 | train |
v3 | Schema:
shipments (alias: shp)(type, name, status, salary)
tasks(code, status, date, level)
Task: Retrieve salary from shipments with value above the AVG(salary) of tasks rows sharing the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14483 | train |
v2 | Schema:
transactions (alias: txn)(value, code, name, amount)
shipments(date, value, amount, status)
Task: Find amount from transactions where a matching record exists in shipments with the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14484 | train |
v2 | Schema:
customers (alias: cust)(status, code, value, type)
invoices(id, name, code, date)
Task: Find code from customers where a matching record exists in invoices with the same type.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14485 | train |
v2 | Schema:
shipments (alias: shp)(status, name, value, type)
departments(type, date, amount, id)
Task: Retrieve id from shipments that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14486 | train |
v3 | Schema:
invoices (alias: inv)(amount, value, id, level)
branches(name, id, date, amount)
Task: Retrieve name from invoices with value above the COUNT(value) of branches rows sharing the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14487 | train |
v3 | Schema:
accounts (alias: acct)(value, salary, status, name)
orders(level, date, amount, code)
Task: Retrieve value from accounts with value above the AVG(value) of orders rows sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14488 | train |
v2 | Schema:
categories (alias: catg)(value, code, salary, level)
orders(id, amount, date, status)
Task: Retrieve salary from categories that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14489 | train |
v3 | Schema:
schedules (alias: schd)(amount, id, date, level)
employees(date, status, code, id)
Task: Find name from schedules where value exceeds the average salary from employees for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE value > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14490 | train |
v1 | Schema:
departments (alias: dept)(date, type, name, id)
customers(name, salary, code, level)
Task: Find salary from departments where code appears in customers entries with matching status.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14491 | train |
v2 | Schema:
projects (alias: prj)(id, name, date, value)
products(status, code, date, name)
Task: Retrieve id from projects that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14492 | train |
v3 | Schema:
projects (alias: prj)(amount, date, value, salary)
requests(type, date, value, code)
Task: Find id from projects where value exceeds the total amount from requests for the same type.
SQL: | SELECT id FROM projects AS prj
WHERE value > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14493 | train |
v3 | Schema:
orders (alias: ord)(status, level, value, salary)
shipments(type, level, amount, date)
Task: Retrieve name from orders with salary above the COUNT(value) of shipments rows sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14494 | train |
v1 | Schema:
sales (alias: sale)(salary, status, type, amount)
orders(salary, date, code, level)
Task: Find value from sales where id appears in orders entries with matching code.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14495 | train |
v2 | Schema:
projects (alias: prj)(date, status, level, value)
shipments(date, level, status, id)
Task: Retrieve name from projects that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14496 | train |
v3 | Schema:
requests (alias: ordr)(name, value, date, salary)
sales(date, type, level, id)
Task: Find salary from requests where salary exceeds the maximum salary from sales for the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14497 | train |
v3 | Schema:
categories (alias: catg)(status, type, level, date)
products(id, salary, type, value)
Task: Retrieve code from categories with salary above the MIN(value) of products rows sharing the same type.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14498 | train |
v1 | Schema:
departments (alias: dept)(amount, status, salary, date)
transactions(salary, date, type, status)
Task: Retrieve salary from departments whose status is found in transactions rows where level matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.