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:
shipments (alias: shp)(name, type, salary, level)
tasks(type, code, date, name)
Task: Find amount from shipments where a matching record exists in tasks with 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_11400 | train |
v3 | Schema:
items (alias: lne)(name, id, salary, type)
shipments(type, id, value, date)
Task: Retrieve code from items with amount above the COUNT(salary) of shipments rows sharing the same code.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11401 | train |
v2 | Schema:
accounts (alias: acct)(type, status, id, name)
projects(date, code, salary, amount)
Task: Retrieve name from accounts that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11402 | train |
v1 | Schema:
products (alias: prod)(status, date, level, name)
tasks(amount, id, date, value)
Task: Select id from products where type exists in tasks for the same code.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.code = prod.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11403 | train |
v2 | Schema:
staff (alias: empl)(code, type, salary, status)
projects(amount, salary, value, date)
Task: Find name from staff where a matching record exists in projects with the same level.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11404 | train |
v2 | Schema:
regions (alias: rgn)(level, status, value, name)
staff(value, name, code, id)
Task: Find amount from regions where a matching record exists in staff with the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11405 | train |
v1 | Schema:
invoices (alias: inv)(status, amount, value, level)
regions(type, code, level, value)
Task: Find value from invoices where id appears in regions entries with matching type.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11406 | train |
v2 | Schema:
customers (alias: cust)(status, code, type, salary)
accounts(amount, status, date, id)
Task: Find salary from customers where a matching record exists in accounts with the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11407 | train |
v2 | Schema:
accounts (alias: acct)(code, type, level, id)
schedules(type, amount, name, status)
Task: Find salary from accounts where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11408 | train |
v1 | Schema:
orders (alias: ord)(id, code, name, value)
branches(status, date, value, name)
Task: Select code from orders where code exists in branches for the same level.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11409 | train |
v1 | Schema:
tasks (alias: tsk)(level, value, date, salary)
shipments(type, status, code, date)
Task: Select value from tasks where type exists in shipments for the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11410 | train |
v2 | Schema:
employees (alias: emp)(type, id, date, amount)
items(salary, level, id, type)
Task: Find name from employees where a matching record exists in items with the same type.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11411 | train |
v1 | Schema:
regions (alias: rgn)(code, value, status, name)
transactions(date, salary, code, value)
Task: Select code from regions where id exists in transactions for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11412 | train |
v2 | Schema:
employees (alias: emp)(code, amount, status, salary)
products(type, amount, date, level)
Task: Find amount from employees where a matching record exists in products with the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11413 | train |
v3 | Schema:
staff (alias: empl)(name, value, code, salary)
transactions(id, name, type, level)
Task: Retrieve id from staff with amount above the SUM(amount) of transactions rows sharing the same type.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11414 | train |
v1 | Schema:
schedules (alias: schd)(amount, value, type, level)
branches(type, amount, id, value)
Task: Find code from schedules where status appears in branches entries with matching id.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11415 | train |
v2 | Schema:
departments (alias: dept)(code, amount, name, level)
sales(amount, type, status, value)
Task: Find salary from departments where a matching record exists in sales with the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11416 | train |
v3 | Schema:
tasks (alias: tsk)(code, name, salary, level)
regions(amount, value, level, type)
Task: Retrieve value from tasks with amount above the SUM(salary) of regions rows sharing the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11417 | train |
v2 | Schema:
invoices (alias: inv)(salary, level, value, status)
employees(salary, id, level, code)
Task: Retrieve code from invoices that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11418 | train |
v1 | Schema:
accounts (alias: acct)(code, value, name, id)
employees(status, id, code, value)
Task: Retrieve name from accounts whose code is found in employees rows where code matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11419 | train |
v3 | Schema:
regions (alias: rgn)(amount, level, type, id)
invoices(level, name, code, status)
Task: Find id from regions where amount exceeds the maximum amount from invoices for the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11420 | train |
v3 | Schema:
categories (alias: catg)(date, id, level, value)
staff(name, salary, id, status)
Task: Retrieve name from categories with value above the AVG(amount) of staff rows sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11421 | train |
v3 | Schema:
items (alias: lne)(value, salary, amount, level)
invoices(id, type, date, level)
Task: Retrieve amount from items with value above the MIN(value) of invoices rows sharing the same type.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.type = lne.type
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11422 | train |
v2 | Schema:
projects (alias: prj)(code, status, value, id)
invoices(status, level, date, salary)
Task: Find name from projects where a matching record exists in invoices with the same code.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11423 | train |
v2 | Schema:
customers (alias: cust)(salary, type, level, id)
branches(id, type, salary, amount)
Task: Find value from customers where a matching record exists in branches with the same id.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11424 | train |
v1 | Schema:
shipments (alias: shp)(level, date, id, type)
transactions(id, type, amount, date)
Task: Find salary from shipments where id appears in transactions entries with matching id.
SQL: | SELECT salary FROM shipments AS shp
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11425 | train |
v1 | Schema:
requests (alias: ordr)(amount, date, name, type)
items(level, value, salary, status)
Task: Find amount from requests where status appears in items entries with matching type.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11426 | train |
v1 | Schema:
managers (alias: mgr)(code, id, status, amount)
employees(value, date, salary, amount)
Task: Retrieve code from managers whose level is found in employees rows where status matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11427 | train |
v3 | Schema:
projects (alias: prj)(status, salary, level, code)
employees(id, type, status, value)
Task: Retrieve id from projects with salary above the SUM(amount) of employees rows sharing the same code.
SQL: | SELECT id FROM projects AS prj
WHERE salary > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11428 | train |
v2 | Schema:
customers (alias: cust)(code, salary, amount, type)
shipments(status, salary, date, code)
Task: Find id from customers where a matching record exists in shipments with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11429 | train |
v3 | Schema:
employees (alias: emp)(salary, status, level, name)
items(code, id, amount, salary)
Task: Find name from employees where value exceeds the total value from items for the same level.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT SUM(value) FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11430 | train |
v2 | Schema:
sales (alias: sale)(type, date, id, level)
schedules(date, value, salary, code)
Task: Find name from sales where a matching record exists in schedules with the same type.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11431 | train |
v3 | Schema:
items (alias: lne)(value, name, type, date)
branches(id, amount, status, date)
Task: Retrieve name from items with value above the COUNT(value) of branches rows sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.id = lne.id
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11432 | train |
v1 | Schema:
staff (alias: empl)(salary, status, date, value)
schedules(name, level, type, value)
Task: Find name from staff where level appears in schedules entries with matching level.
SQL: | SELECT name FROM staff AS empl
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11433 | train |
v1 | Schema:
branches (alias: brc)(date, code, level, id)
customers(date, name, salary, status)
Task: Retrieve id from branches whose type is found in customers rows where status matches the outer record.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11434 | train |
v3 | Schema:
orders (alias: ord)(status, code, salary, id)
projects(date, code, name, id)
Task: Find value from orders where amount exceeds the minimum salary from projects for the same type.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11435 | train |
v3 | Schema:
departments (alias: dept)(amount, date, id, salary)
managers(value, status, amount, code)
Task: Retrieve value from departments with amount above the MIN(salary) of managers rows sharing the same level.
SQL: | SELECT value FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11436 | train |
v1 | Schema:
shipments (alias: shp)(id, code, status, amount)
categories(salary, level, value, status)
Task: Select code from shipments where level exists in categories for the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11437 | train |
v3 | Schema:
products (alias: prod)(status, amount, level, value)
requests(name, salary, amount, value)
Task: Retrieve value from products with value above the COUNT(salary) of requests rows sharing the same id.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11438 | train |
v3 | Schema:
categories (alias: catg)(type, level, id, amount)
products(id, level, status, type)
Task: Find salary from categories where value exceeds the count of value from products for the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11439 | train |
v2 | Schema:
projects (alias: prj)(value, code, type, date)
staff(salary, level, value, id)
Task: Find amount from projects where a matching record exists in staff with the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11440 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, name, type)
employees(name, status, level, salary)
Task: Retrieve amount from shipments that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11441 | train |
v1 | Schema:
branches (alias: brc)(id, value, level, status)
schedules(date, status, name, amount)
Task: Retrieve salary from branches whose id is found in schedules rows where id matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11442 | train |
v2 | Schema:
schedules (alias: schd)(salary, amount, code, date)
customers(id, salary, code, date)
Task: Find id from schedules where a matching record exists in customers with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11443 | train |
v2 | Schema:
shipments (alias: shp)(type, level, value, id)
staff(level, code, name, salary)
Task: Find id from shipments where a matching record exists in staff with the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11444 | train |
v1 | Schema:
projects (alias: prj)(code, amount, status, value)
customers(amount, code, name, date)
Task: Find value from projects where status appears in customers entries with matching id.
SQL: | SELECT value FROM projects AS prj
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11445 | train |
v1 | Schema:
products (alias: prod)(code, level, id, value)
schedules(code, name, amount, value)
Task: Retrieve amount from products whose type is found in schedules rows where level matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.level = prod.level
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11446 | train |
v2 | Schema:
branches (alias: brc)(type, amount, level, salary)
sales(type, id, date, code)
Task: Retrieve salary from branches that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11447 | train |
v3 | Schema:
products (alias: prod)(date, amount, name, code)
regions(name, level, type, code)
Task: Find amount from products where value exceeds the average value from regions for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11448 | train |
v1 | Schema:
customers (alias: cust)(type, status, salary, name)
projects(code, amount, level, salary)
Task: Find code from customers where type appears in projects entries with matching id.
SQL: | SELECT code FROM customers AS cust
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11449 | train |
v1 | Schema:
sales (alias: sale)(amount, salary, id, status)
invoices(value, amount, name, code)
Task: Select name from sales where status exists in invoices for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11450 | train |
v3 | Schema:
projects (alias: prj)(type, code, name, id)
sales(level, name, salary, date)
Task: Retrieve amount from projects with salary above the AVG(value) of sales rows sharing the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11451 | train |
v1 | Schema:
transactions (alias: txn)(name, amount, salary, type)
sales(value, name, level, status)
Task: Select amount from transactions where status exists in sales for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11452 | train |
v2 | Schema:
projects (alias: prj)(value, amount, type, salary)
shipments(id, type, amount, code)
Task: Find amount from projects where a matching record exists in shipments with the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11453 | train |
v3 | Schema:
projects (alias: prj)(code, type, id, level)
accounts(code, salary, id, status)
Task: Find id from projects where salary exceeds the minimum amount from accounts for the same status.
SQL: | SELECT id FROM projects AS prj
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11454 | train |
v2 | Schema:
customers (alias: cust)(code, type, amount, salary)
sales(name, amount, salary, code)
Task: Retrieve value from customers that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11455 | train |
v1 | Schema:
employees (alias: emp)(date, name, level, salary)
accounts(amount, salary, name, date)
Task: Select amount from employees where status exists in accounts for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11456 | train |
v3 | Schema:
managers (alias: mgr)(value, date, level, id)
staff(name, salary, type, id)
Task: Find salary from managers where amount exceeds the count of value from staff for the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11457 | train |
v1 | Schema:
requests (alias: ordr)(date, name, code, salary)
products(status, level, value, date)
Task: Retrieve value from requests whose level is found in products rows where type matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11458 | train |
v1 | Schema:
invoices (alias: inv)(value, type, name, date)
managers(status, date, type, level)
Task: Select salary from invoices where type exists in managers for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11459 | train |
v3 | Schema:
customers (alias: cust)(id, code, date, salary)
items(salary, code, status, level)
Task: Retrieve code from customers with salary above the COUNT(amount) of items rows sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11460 | train |
v2 | Schema:
departments (alias: dept)(id, name, value, type)
items(amount, name, value, code)
Task: Find value from departments where a matching record exists in items with the same code.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11461 | train |
v1 | Schema:
accounts (alias: acct)(date, amount, value, code)
managers(name, type, amount, level)
Task: Find code from accounts where id appears in managers entries with matching type.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11462 | train |
v2 | Schema:
accounts (alias: acct)(type, value, id, level)
requests(salary, level, amount, name)
Task: Retrieve code from accounts that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11463 | train |
v3 | Schema:
accounts (alias: acct)(id, salary, date, code)
schedules(salary, amount, level, type)
Task: Retrieve value from accounts with salary above the MIN(salary) of schedules rows sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11464 | train |
v1 | Schema:
employees (alias: emp)(level, id, amount, code)
customers(level, status, date, salary)
Task: Find value from employees where code appears in customers entries with matching status.
SQL: | SELECT value FROM employees AS emp
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11465 | train |
v3 | Schema:
sales (alias: sale)(level, status, type, code)
orders(name, date, id, code)
Task: Find salary from sales where amount exceeds the average salary from orders for the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11466 | train |
v3 | Schema:
customers (alias: cust)(id, name, amount, status)
accounts(date, level, id, salary)
Task: Retrieve value from customers with salary above the COUNT(amount) of accounts rows sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11467 | train |
v2 | Schema:
products (alias: prod)(type, status, code, salary)
requests(type, status, salary, value)
Task: Retrieve salary from products that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11468 | train |
v1 | Schema:
staff (alias: empl)(date, salary, level, type)
transactions(level, status, value, date)
Task: Select amount from staff where level exists in transactions for the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11469 | train |
v2 | Schema:
transactions (alias: txn)(salary, level, status, code)
managers(level, status, amount, value)
Task: Find value from transactions where a matching record exists in managers with the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11470 | train |
v2 | Schema:
orders (alias: ord)(salary, type, status, id)
products(type, salary, date, name)
Task: Retrieve amount from orders that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11471 | train |
v2 | Schema:
customers (alias: cust)(salary, status, name, date)
tasks(salary, status, code, amount)
Task: Find salary from customers where a matching record exists in tasks with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11472 | train |
v2 | Schema:
branches (alias: brc)(code, id, name, type)
items(type, salary, amount, value)
Task: Retrieve code from branches that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11473 | train |
v2 | Schema:
employees (alias: emp)(name, type, level, id)
projects(type, id, level, amount)
Task: Retrieve name from employees that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11474 | train |
v1 | Schema:
employees (alias: emp)(amount, name, level, value)
schedules(amount, name, value, type)
Task: Select salary from employees where code exists in schedules for the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11475 | train |
v2 | Schema:
shipments (alias: shp)(status, value, id, name)
managers(salary, type, id, date)
Task: Find id from shipments where a matching record exists in managers with the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11476 | train |
v1 | Schema:
branches (alias: brc)(salary, level, id, status)
sales(code, status, value, type)
Task: Select id from branches where status exists in sales for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11477 | train |
v2 | Schema:
transactions (alias: txn)(status, date, code, amount)
orders(value, salary, type, code)
Task: Retrieve name from transactions that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11478 | train |
v3 | Schema:
regions (alias: rgn)(date, type, id, value)
categories(id, salary, code, amount)
Task: Retrieve id from regions with amount above the MIN(value) of categories rows sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11479 | train |
v3 | Schema:
schedules (alias: schd)(id, name, amount, value)
projects(status, amount, level, name)
Task: Find id from schedules where salary exceeds the total amount from projects for the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11480 | train |
v2 | Schema:
departments (alias: dept)(amount, date, id, value)
shipments(date, level, name, status)
Task: Retrieve salary from departments that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11481 | train |
v1 | Schema:
staff (alias: empl)(salary, level, code, value)
products(salary, status, date, value)
Task: Select name from staff where status exists in products for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11482 | train |
v2 | Schema:
schedules (alias: schd)(level, value, name, salary)
accounts(salary, name, date, code)
Task: Find id from schedules where a matching record exists in accounts with the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11483 | train |
v2 | Schema:
items (alias: lne)(name, date, status, amount)
requests(code, status, amount, id)
Task: Retrieve amount from items that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11484 | train |
v2 | Schema:
staff (alias: empl)(name, id, status, code)
departments(type, value, salary, date)
Task: Find code from staff where a matching record exists in departments with the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11485 | train |
v2 | Schema:
employees (alias: emp)(salary, date, value, id)
managers(code, id, value, name)
Task: Find name from employees where a matching record exists in managers with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11486 | train |
v3 | Schema:
invoices (alias: inv)(level, amount, status, salary)
customers(level, salary, name, code)
Task: Find name from invoices where salary exceeds the maximum salary from customers for the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11487 | train |
v2 | Schema:
orders (alias: ord)(id, value, type, code)
customers(status, salary, amount, name)
Task: Retrieve salary from orders that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11488 | train |
v2 | Schema:
departments (alias: dept)(status, id, name, date)
items(date, value, status, code)
Task: Find name from departments where a matching record exists in items with the same code.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11489 | train |
v3 | Schema:
invoices (alias: inv)(level, id, date, value)
managers(code, id, level, type)
Task: Retrieve amount from invoices with amount above the MIN(salary) of managers rows sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11490 | train |
v1 | Schema:
staff (alias: empl)(value, amount, status, type)
sales(code, type, date, status)
Task: Retrieve code from staff whose code is found in sales rows where level matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11491 | train |
v1 | Schema:
projects (alias: prj)(code, id, salary, status)
transactions(name, code, id, salary)
Task: Retrieve value from projects whose status is found in transactions rows where id matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11492 | train |
v3 | Schema:
managers (alias: mgr)(date, name, amount, level)
regions(date, salary, level, amount)
Task: Find value from managers where salary exceeds the count of value from regions for the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11493 | train |
v2 | Schema:
departments (alias: dept)(code, date, amount, value)
schedules(amount, level, type, status)
Task: Find salary from departments where a matching record exists in schedules with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11494 | train |
v1 | Schema:
sales (alias: sale)(code, id, type, date)
departments(date, salary, type, value)
Task: Retrieve value from sales whose type is found in departments rows where level matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11495 | train |
v2 | Schema:
transactions (alias: txn)(salary, date, code, value)
products(salary, status, amount, level)
Task: Retrieve code from transactions that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11496 | train |
v1 | Schema:
shipments (alias: shp)(name, amount, level, status)
orders(value, amount, code, level)
Task: Select value from shipments where level exists in orders for the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11497 | train |
v3 | Schema:
requests (alias: ordr)(code, id, status, value)
categories(status, salary, name, id)
Task: Find value from requests where salary exceeds the total salary from categories for the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11498 | train |
v1 | Schema:
branches (alias: brc)(type, status, date, id)
categories(status, code, level, type)
Task: Select amount from branches where status exists in categories for the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.