variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
transactions (alias: txn)(status, value, salary, amount)
projects(level, status, code, amount)
Task: Retrieve name from transactions whose id is found in projects rows where id matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15300 | train |
v3 | Schema:
staff (alias: empl)(value, date, salary, type)
branches(level, value, name, salary)
Task: Find value from staff where salary exceeds the average salary from branches for the same code.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15301 | train |
v3 | Schema:
tasks (alias: tsk)(salary, type, status, level)
departments(id, salary, name, value)
Task: Retrieve name from tasks with salary above the AVG(amount) of departments rows sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"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_15302 | train |
v3 | Schema:
customers (alias: cust)(amount, type, code, salary)
requests(value, code, amount, level)
Task: Retrieve name from customers with value above the COUNT(value) of requests rows sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15303 | train |
v2 | Schema:
accounts (alias: acct)(id, value, status, level)
transactions(type, status, value, code)
Task: Retrieve code from accounts that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15304 | train |
v3 | Schema:
departments (alias: dept)(type, value, status, name)
tasks(amount, value, level, code)
Task: Retrieve amount from departments with value above the MAX(salary) of tasks rows sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT MAX(salary) FROM tasks AS tsk
WHERE tsk.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15305 | train |
v1 | Schema:
projects (alias: prj)(date, value, code, level)
invoices(type, amount, level, name)
Task: Find value from projects where type appears in invoices entries with matching id.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15306 | train |
v1 | Schema:
customers (alias: cust)(date, salary, amount, status)
orders(type, code, salary, name)
Task: Find code from customers where code appears in orders entries with matching id.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15307 | train |
v3 | Schema:
orders (alias: ord)(level, value, amount, salary)
customers(code, status, date, type)
Task: Retrieve id from orders with value above the AVG(amount) of customers rows sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15308 | train |
v1 | Schema:
schedules (alias: schd)(name, salary, code, amount)
transactions(amount, value, date, type)
Task: Select code from schedules where code exists in transactions for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15309 | train |
v3 | Schema:
shipments (alias: shp)(date, amount, type, level)
regions(date, salary, value, name)
Task: Find value from shipments where salary exceeds the minimum amount from regions for the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15310 | train |
v1 | Schema:
customers (alias: cust)(date, type, level, id)
regions(salary, level, status, type)
Task: Retrieve value from customers whose level is found in regions rows where type matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15311 | train |
v3 | Schema:
staff (alias: empl)(date, code, amount, salary)
transactions(name, type, id, level)
Task: Find code from staff where amount exceeds the total value from transactions for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15312 | train |
v3 | Schema:
employees (alias: emp)(date, name, amount, code)
branches(value, amount, id, status)
Task: Retrieve code from employees with amount above the MIN(value) of branches rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15313 | train |
v3 | Schema:
departments (alias: dept)(level, status, date, code)
tasks(date, name, level, id)
Task: Retrieve amount from departments with salary above the AVG(salary) of tasks rows sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15314 | train |
v2 | Schema:
employees (alias: emp)(id, type, salary, name)
invoices(id, code, status, value)
Task: Retrieve salary from employees that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15315 | train |
v1 | Schema:
orders (alias: ord)(type, amount, salary, date)
accounts(name, code, status, type)
Task: Find name from orders where code appears in accounts entries with matching type.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15316 | train |
v3 | Schema:
employees (alias: emp)(status, salary, date, level)
managers(id, level, name, amount)
Task: Retrieve salary from employees with amount above the AVG(value) of managers rows sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15317 | train |
v1 | Schema:
projects (alias: prj)(date, id, amount, value)
products(salary, value, date, level)
Task: Retrieve amount from projects whose code is found in products rows where type matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15318 | train |
v1 | Schema:
shipments (alias: shp)(date, id, name, type)
products(date, name, salary, id)
Task: Retrieve value from shipments whose level is found in products rows where status matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15319 | train |
v1 | Schema:
projects (alias: prj)(id, salary, status, value)
sales(level, id, value, code)
Task: Select value from projects where code exists in sales for the same code.
SQL: | SELECT value FROM projects AS prj
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15320 | train |
v3 | Schema:
projects (alias: prj)(name, salary, amount, type)
requests(type, salary, status, date)
Task: Retrieve salary from projects with value above the COUNT(value) of requests rows sharing the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE value > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15321 | train |
v1 | Schema:
managers (alias: mgr)(id, amount, code, level)
employees(value, salary, status, amount)
Task: Find code from managers where id appears in employees entries with matching code.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15322 | train |
v2 | Schema:
requests (alias: ordr)(name, status, value, id)
departments(code, date, salary, status)
Task: Find salary from requests where a matching record exists in departments with the same status.
SQL: | SELECT salary 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": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15323 | train |
v2 | Schema:
employees (alias: emp)(level, id, code, date)
accounts(amount, value, salary, status)
Task: Find id from employees where a matching record exists in accounts with the same level.
SQL: | SELECT id 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": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15324 | train |
v1 | Schema:
shipments (alias: shp)(type, code, id, salary)
transactions(code, name, amount, level)
Task: Retrieve salary from shipments whose status is found in transactions rows where code matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15325 | train |
v1 | Schema:
staff (alias: empl)(code, salary, date, amount)
sales(value, code, name, amount)
Task: Select name from staff where code exists in sales for the same status.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15326 | train |
v3 | Schema:
accounts (alias: acct)(status, code, salary, id)
regions(type, id, status, amount)
Task: Retrieve value from accounts with amount above the SUM(salary) of regions rows sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15327 | train |
v2 | Schema:
projects (alias: prj)(level, name, status, amount)
transactions(date, amount, name, value)
Task: Retrieve code from projects that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15328 | train |
v1 | Schema:
items (alias: lne)(level, id, name, value)
transactions(value, id, code, amount)
Task: Select code from items where type exists in transactions for the same code.
SQL: | SELECT code FROM items AS lne
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15329 | train |
v1 | Schema:
transactions (alias: txn)(status, salary, value, code)
sales(type, salary, code, value)
Task: Find salary from transactions where level appears in sales entries with matching id.
SQL: | SELECT salary FROM transactions AS txn
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15330 | train |
v3 | Schema:
customers (alias: cust)(date, value, type, code)
regions(code, level, status, name)
Task: Find amount from customers where amount exceeds the count of value from regions for the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15331 | train |
v2 | Schema:
accounts (alias: acct)(salary, date, name, code)
categories(amount, code, level, date)
Task: Retrieve name from accounts that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15332 | train |
v1 | Schema:
regions (alias: rgn)(amount, salary, level, type)
items(salary, status, id, level)
Task: Retrieve name from regions whose level is found in items rows where status matches the outer record.
SQL: | SELECT name FROM regions AS rgn
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15333 | train |
v1 | Schema:
products (alias: prod)(level, amount, name, type)
managers(value, amount, level, salary)
Task: Retrieve id from products whose code is found in managers rows where code matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15334 | train |
v1 | Schema:
invoices (alias: inv)(salary, date, level, value)
managers(salary, level, id, status)
Task: Find code from invoices where type appears in managers entries with matching level.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15335 | train |
v3 | Schema:
transactions (alias: txn)(salary, code, type, amount)
shipments(status, salary, type, id)
Task: Retrieve code from transactions with amount above the COUNT(amount) of shipments rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15336 | train |
v2 | Schema:
items (alias: lne)(amount, code, value, salary)
orders(amount, name, level, salary)
Task: Find value from items where a matching record exists in orders with the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15337 | train |
v3 | Schema:
accounts (alias: acct)(type, name, status, value)
projects(type, value, status, level)
Task: Retrieve id from accounts with salary above the MIN(value) of projects rows sharing the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15338 | train |
v2 | Schema:
requests (alias: ordr)(amount, id, value, date)
employees(amount, salary, status, date)
Task: Find value from requests where a matching record exists in employees with the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15339 | train |
v1 | Schema:
projects (alias: prj)(salary, code, level, status)
invoices(status, name, code, id)
Task: Retrieve id from projects whose id is found in invoices rows where id matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15340 | train |
v2 | Schema:
schedules (alias: schd)(date, id, value, status)
products(value, status, id, code)
Task: Find id from schedules where a matching record exists in products with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15341 | train |
v3 | Schema:
projects (alias: prj)(type, value, name, salary)
shipments(level, date, type, id)
Task: Find code from projects where value exceeds the total value from shipments for the same level.
SQL: | SELECT code FROM projects AS prj
WHERE value > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15342 | train |
v3 | Schema:
accounts (alias: acct)(value, name, id, level)
categories(name, salary, value, code)
Task: Find code from accounts where amount exceeds the average salary from categories for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15343 | train |
v3 | Schema:
regions (alias: rgn)(value, type, level, amount)
transactions(status, level, date, type)
Task: Find value from regions where amount exceeds the total amount from transactions for the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15344 | train |
v1 | Schema:
accounts (alias: acct)(amount, date, salary, id)
transactions(salary, status, id, code)
Task: Find salary from accounts where status appears in transactions entries with matching code.
SQL: | SELECT salary FROM accounts AS acct
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15345 | train |
v2 | Schema:
regions (alias: rgn)(id, status, name, type)
branches(code, name, id, amount)
Task: Retrieve id from regions that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15346 | train |
v2 | Schema:
shipments (alias: shp)(id, salary, status, date)
accounts(id, level, code, status)
Task: Retrieve salary from shipments that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15347 | train |
v1 | Schema:
projects (alias: prj)(name, amount, status, date)
transactions(name, type, amount, salary)
Task: Retrieve id from projects whose level is found in transactions rows where status matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15348 | train |
v2 | Schema:
staff (alias: empl)(status, id, code, level)
projects(salary, value, date, code)
Task: Retrieve code from staff that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15349 | train |
v2 | Schema:
managers (alias: mgr)(date, code, name, salary)
departments(date, amount, name, value)
Task: Retrieve id from managers that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15350 | train |
v2 | Schema:
departments (alias: dept)(id, level, date, salary)
transactions(level, code, type, id)
Task: Retrieve id from departments that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15351 | train |
v1 | Schema:
managers (alias: mgr)(name, amount, type, id)
regions(status, id, amount, type)
Task: Retrieve id from managers whose id is found in regions rows where status matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15352 | train |
v2 | Schema:
invoices (alias: inv)(level, status, type, code)
staff(id, value, name, level)
Task: Retrieve value from invoices that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15353 | train |
v1 | Schema:
branches (alias: brc)(date, name, code, salary)
customers(type, level, id, date)
Task: Find value from branches where level appears in customers entries with matching level.
SQL: | SELECT value FROM branches AS brc
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15354 | train |
v1 | Schema:
tasks (alias: tsk)(id, status, value, salary)
schedules(type, id, amount, salary)
Task: Retrieve id from tasks whose code is found in schedules rows where code matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15355 | train |
v1 | Schema:
departments (alias: dept)(code, amount, salary, status)
sales(level, name, id, date)
Task: Retrieve name from departments whose status is found in sales rows where code matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15356 | train |
v2 | Schema:
regions (alias: rgn)(code, level, salary, name)
departments(value, type, level, id)
Task: Find value from regions where a matching record exists in departments with the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15357 | train |
v2 | Schema:
orders (alias: ord)(status, level, amount, name)
projects(status, id, code, value)
Task: Find code from orders where a matching record exists in projects with the same id.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15358 | train |
v2 | Schema:
products (alias: prod)(value, amount, name, salary)
sales(status, code, value, date)
Task: Retrieve id from products that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15359 | train |
v1 | Schema:
projects (alias: prj)(value, level, id, amount)
products(value, name, type, code)
Task: Select name from projects where status exists in products for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15360 | train |
v1 | Schema:
items (alias: lne)(value, date, code, amount)
managers(value, code, id, name)
Task: Find id from items where level appears in managers entries with matching level.
SQL: | SELECT id FROM items AS lne
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15361 | train |
v3 | Schema:
schedules (alias: schd)(status, name, code, amount)
sales(name, amount, date, level)
Task: Find code from schedules where amount exceeds the minimum salary from sales for the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15362 | train |
v3 | Schema:
regions (alias: rgn)(status, type, name, date)
tasks(name, status, id, level)
Task: Retrieve value from regions with value above the SUM(amount) of tasks rows sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15363 | train |
v1 | Schema:
products (alias: prod)(date, value, status, id)
customers(code, amount, name, id)
Task: Retrieve salary from products whose type is found in customers rows where code matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15364 | train |
v2 | Schema:
categories (alias: catg)(id, amount, code, status)
projects(type, level, date, status)
Task: Retrieve code from categories that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15365 | train |
v1 | Schema:
categories (alias: catg)(amount, status, value, salary)
shipments(name, code, value, type)
Task: Find id from categories where id appears in shipments entries with matching status.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15366 | train |
v3 | Schema:
projects (alias: prj)(type, amount, id, status)
products(id, code, value, level)
Task: Find id from projects where amount exceeds the total amount from products for the same status.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15367 | train |
v3 | Schema:
invoices (alias: inv)(amount, type, id, date)
schedules(level, amount, salary, name)
Task: Find amount from invoices where value exceeds the average salary from schedules for the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15368 | train |
v3 | Schema:
branches (alias: brc)(status, code, name, date)
regions(date, id, status, type)
Task: Retrieve id from branches with salary above the AVG(value) of regions rows sharing the same id.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15369 | train |
v3 | Schema:
branches (alias: brc)(name, status, code, type)
staff(name, code, date, status)
Task: Find salary from branches where salary exceeds the minimum value from staff for the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15370 | train |
v3 | Schema:
schedules (alias: schd)(name, amount, level, value)
transactions(value, name, date, code)
Task: Retrieve value from schedules with value above the AVG(salary) of transactions rows sharing the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15371 | train |
v2 | Schema:
accounts (alias: acct)(date, salary, level, status)
staff(amount, date, salary, code)
Task: Retrieve value from accounts that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15372 | train |
v2 | Schema:
projects (alias: prj)(level, name, status, salary)
employees(date, amount, status, id)
Task: Retrieve name from projects that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15373 | train |
v3 | Schema:
shipments (alias: shp)(level, code, salary, status)
staff(salary, name, value, date)
Task: Find name from shipments where amount exceeds the average value from staff for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15374 | train |
v3 | Schema:
shipments (alias: shp)(type, value, salary, level)
sales(salary, amount, date, name)
Task: Retrieve salary from shipments with amount above the MAX(value) of sales rows sharing the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15375 | train |
v1 | Schema:
products (alias: prod)(code, id, type, level)
transactions(date, id, level, type)
Task: Select id from products where id exists in transactions for the same code.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = prod.code
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15376 | train |
v2 | Schema:
items (alias: lne)(salary, level, date, type)
departments(code, type, status, amount)
Task: Find name from items where a matching record exists in departments with the same id.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = lne.id
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15377 | train |
v3 | Schema:
items (alias: lne)(salary, date, name, type)
managers(name, level, date, value)
Task: Retrieve code from items with salary above the AVG(amount) of managers rows sharing the same type.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15378 | train |
v3 | Schema:
products (alias: prod)(level, name, salary, id)
items(salary, level, name, status)
Task: Retrieve id from products with value above the SUM(salary) of items rows sharing the same code.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.code = prod.code
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15379 | train |
v2 | Schema:
employees (alias: emp)(code, value, level, date)
departments(status, type, amount, name)
Task: Find salary from employees where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15380 | train |
v1 | Schema:
shipments (alias: shp)(value, id, level, type)
projects(salary, type, value, level)
Task: Select id from shipments where type exists in projects for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15381 | train |
v1 | Schema:
staff (alias: empl)(code, date, name, amount)
branches(status, id, amount, level)
Task: Retrieve value from staff whose code is found in branches rows where id matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15382 | train |
v1 | Schema:
requests (alias: ordr)(name, amount, level, date)
customers(name, type, code, date)
Task: Retrieve name from requests whose type is found in customers rows where type matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15383 | train |
v3 | Schema:
staff (alias: empl)(date, status, type, id)
projects(value, date, status, name)
Task: Retrieve salary from staff with amount above the COUNT(amount) of projects rows sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT COUNT(amount) FROM projects AS prj
WHERE prj.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15384 | train |
v1 | Schema:
accounts (alias: acct)(type, value, amount, code)
transactions(amount, level, date, status)
Task: Select amount from accounts where type exists in transactions for the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15385 | train |
v3 | Schema:
regions (alias: rgn)(code, name, level, type)
products(level, type, name, value)
Task: Retrieve code from regions with salary above the COUNT(amount) of products rows sharing the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15386 | train |
v3 | Schema:
employees (alias: emp)(id, code, level, date)
categories(date, name, value, status)
Task: Find code from employees where salary exceeds the count of salary from categories for the same id.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15387 | train |
v1 | Schema:
orders (alias: ord)(amount, name, date, salary)
products(type, value, id, code)
Task: Find value from orders where code appears in products entries with matching code.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15388 | train |
v3 | Schema:
branches (alias: brc)(salary, status, code, level)
sales(status, date, name, id)
Task: Retrieve code from branches with amount above the MAX(amount) of sales rows sharing the same id.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15389 | train |
v2 | Schema:
products (alias: prod)(id, type, name, amount)
projects(code, status, id, amount)
Task: Find code from products where a matching record exists in projects with the same level.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = prod.level
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15390 | train |
v1 | Schema:
staff (alias: empl)(amount, date, level, type)
shipments(type, level, salary, id)
Task: Select id from staff where status exists in shipments for the same type.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15391 | train |
v1 | Schema:
staff (alias: empl)(amount, level, value, type)
managers(value, level, name, code)
Task: Find id from staff where status appears in managers entries with matching code.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15392 | train |
v3 | Schema:
customers (alias: cust)(value, code, status, date)
branches(type, level, amount, id)
Task: Retrieve code from customers with salary above the AVG(amount) of branches rows sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15393 | train |
v2 | Schema:
shipments (alias: shp)(date, amount, name, salary)
branches(type, date, value, amount)
Task: Retrieve value from shipments that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15394 | train |
v2 | Schema:
categories (alias: catg)(amount, id, status, level)
projects(id, salary, value, amount)
Task: Retrieve value from categories that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15395 | train |
v3 | Schema:
branches (alias: brc)(type, name, level, code)
tasks(date, code, value, status)
Task: Retrieve name from branches with salary above the AVG(salary) of tasks rows sharing the same code.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT AVG(salary) FROM tasks AS tsk
WHERE tsk.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15396 | train |
v2 | Schema:
branches (alias: brc)(value, code, status, name)
employees(date, code, status, amount)
Task: Find value from branches where a matching record exists in employees with the same code.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15397 | train |
v2 | Schema:
tasks (alias: tsk)(date, type, status, level)
requests(name, salary, level, status)
Task: Find code from tasks where a matching record exists in requests with 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_15398 | train |
v2 | Schema:
tasks (alias: tsk)(name, status, level, type)
requests(id, salary, status, date)
Task: Find name from tasks where a matching record exists in requests with the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.