variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
shipments (alias: shp)(salary, type, level, name)
departments(level, amount, status, date)
Task: Find code from shipments where salary exceeds the minimum amount from departments for the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "code",
"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_14100 | train |
v3 | Schema:
items (alias: lne)(value, type, name, id)
invoices(status, date, name, amount)
Task: Retrieve code from items with salary above the COUNT(salary) of invoices rows sharing the same type.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM invoices AS inv
WHERE inv.type = lne.type
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14101 | train |
v1 | Schema:
customers (alias: cust)(name, code, id, level)
accounts(value, salary, status, name)
Task: Find name from customers where type appears in accounts entries with matching level.
SQL: | SELECT name FROM customers AS cust
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14102 | train |
v1 | Schema:
categories (alias: catg)(level, id, date, amount)
requests(type, status, salary, level)
Task: Select value from categories where id exists in requests for the same id.
SQL: | SELECT value FROM categories AS catg
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14103 | train |
v2 | Schema:
sales (alias: sale)(name, date, salary, amount)
projects(name, amount, salary, level)
Task: Find id from sales where a matching record exists in projects with the same id.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14104 | train |
v2 | Schema:
transactions (alias: txn)(name, id, status, salary)
tasks(id, value, salary, name)
Task: Retrieve id from transactions that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14105 | train |
v1 | Schema:
categories (alias: catg)(code, status, salary, type)
staff(id, name, type, level)
Task: Find id from categories where level appears in staff entries with matching status.
SQL: | SELECT id FROM categories AS catg
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14106 | train |
v3 | Schema:
requests (alias: ordr)(date, salary, amount, name)
categories(value, id, salary, level)
Task: Retrieve amount from requests with salary above the MAX(salary) of categories rows sharing the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14107 | train |
v3 | Schema:
shipments (alias: shp)(salary, amount, value, type)
departments(name, level, date, type)
Task: Retrieve salary from shipments with amount above the MAX(amount) of departments rows sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14108 | train |
v2 | Schema:
schedules (alias: schd)(value, type, level, id)
customers(value, level, type, name)
Task: Find name from schedules where a matching record exists in customers with the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14109 | train |
v3 | Schema:
categories (alias: catg)(amount, status, code, value)
tasks(amount, id, name, level)
Task: Retrieve name from categories with amount above the MIN(amount) of tasks rows sharing the same status.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT MIN(amount) FROM tasks AS tsk
WHERE tsk.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14110 | train |
v2 | Schema:
products (alias: prod)(amount, salary, name, date)
schedules(status, id, level, type)
Task: Find value from products where a matching record exists in schedules with the same level.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = prod.level
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14111 | train |
v3 | Schema:
departments (alias: dept)(code, salary, id, date)
customers(name, code, date, amount)
Task: Find amount from departments where salary exceeds the count of value from customers for the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14112 | train |
v1 | Schema:
accounts (alias: acct)(amount, id, level, salary)
tasks(date, type, level, salary)
Task: Retrieve value from accounts whose status is found in tasks rows where status matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14113 | train |
v2 | Schema:
products (alias: prod)(level, status, name, type)
shipments(date, salary, status, name)
Task: Retrieve value from products that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14114 | train |
v1 | Schema:
shipments (alias: shp)(id, type, amount, name)
accounts(code, amount, status, name)
Task: Select salary from shipments where level exists in accounts for the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14115 | train |
v1 | Schema:
invoices (alias: inv)(salary, type, id, code)
orders(id, salary, type, amount)
Task: Find id from invoices where status appears in orders entries with matching type.
SQL: | SELECT id FROM invoices AS inv
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14116 | train |
v2 | Schema:
tasks (alias: tsk)(value, salary, amount, level)
categories(salary, value, code, status)
Task: Retrieve amount from tasks that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14117 | train |
v3 | Schema:
orders (alias: ord)(value, name, salary, id)
projects(amount, code, salary, id)
Task: Retrieve name from orders with value above the SUM(salary) of projects rows sharing the same code.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT SUM(salary) FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14118 | train |
v3 | Schema:
invoices (alias: inv)(date, status, id, type)
accounts(value, amount, name, type)
Task: Retrieve id from invoices with amount above the COUNT(value) of accounts rows sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14119 | train |
v2 | Schema:
staff (alias: empl)(id, code, salary, date)
employees(name, type, status, code)
Task: Retrieve name from staff that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14120 | train |
v1 | Schema:
branches (alias: brc)(status, value, name, level)
departments(date, name, value, salary)
Task: Find name from branches where type appears in departments entries with matching type.
SQL: | SELECT name FROM branches AS brc
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14121 | train |
v2 | Schema:
branches (alias: brc)(name, amount, id, level)
staff(status, type, salary, level)
Task: Retrieve name from branches that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14122 | train |
v1 | Schema:
transactions (alias: txn)(name, code, date, value)
managers(type, value, amount, code)
Task: Find value from transactions where code appears in managers entries with matching id.
SQL: | SELECT value FROM transactions AS txn
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14123 | train |
v2 | Schema:
shipments (alias: shp)(type, salary, amount, code)
transactions(id, value, level, name)
Task: Find value from shipments where a matching record exists in transactions with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14124 | train |
v2 | Schema:
products (alias: prod)(name, type, level, code)
departments(level, id, value, name)
Task: Retrieve salary from products that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14125 | train |
v2 | Schema:
requests (alias: ordr)(name, date, type, amount)
branches(status, id, amount, salary)
Task: Find value from requests where a matching record exists in branches with the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14126 | train |
v3 | Schema:
sales (alias: sale)(type, id, status, value)
projects(type, value, code, date)
Task: Find name from sales where amount exceeds the total value from projects for the same status.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14127 | train |
v2 | Schema:
regions (alias: rgn)(value, status, name, code)
orders(date, level, salary, name)
Task: Retrieve code from regions that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14128 | train |
v2 | Schema:
managers (alias: mgr)(salary, date, status, code)
customers(type, value, amount, id)
Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14129 | train |
v3 | Schema:
invoices (alias: inv)(value, level, type, code)
products(status, salary, type, value)
Task: Find amount from invoices where value exceeds the minimum value from products for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14130 | train |
v1 | Schema:
orders (alias: ord)(value, status, salary, id)
staff(date, id, name, value)
Task: Find code from orders where code appears in staff entries with matching status.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14131 | train |
v1 | Schema:
invoices (alias: inv)(value, level, id, salary)
managers(date, status, amount, salary)
Task: Retrieve name from invoices whose level is found in managers rows where level matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14132 | train |
v2 | Schema:
staff (alias: empl)(status, code, value, amount)
employees(status, amount, type, level)
Task: Retrieve code from staff that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14133 | train |
v3 | Schema:
orders (alias: ord)(id, salary, amount, name)
sales(type, code, salary, amount)
Task: Retrieve value from orders with amount above the MAX(value) of sales rows sharing the same code.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14134 | train |
v1 | Schema:
invoices (alias: inv)(level, amount, value, date)
categories(name, salary, date, value)
Task: Retrieve value from invoices whose type is found in categories rows where code matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14135 | train |
v1 | Schema:
requests (alias: ordr)(amount, type, level, name)
customers(code, amount, level, value)
Task: Select name from requests where type exists in customers for the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14136 | train |
v2 | Schema:
requests (alias: ordr)(name, type, salary, amount)
products(date, amount, code, id)
Task: Retrieve value from requests that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14137 | train |
v3 | Schema:
departments (alias: dept)(name, type, value, amount)
invoices(name, code, amount, id)
Task: Find salary from departments where salary exceeds the minimum salary from invoices for the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14138 | train |
v2 | Schema:
sales (alias: sale)(level, date, salary, type)
products(level, code, date, type)
Task: Retrieve name from sales that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14139 | train |
v3 | Schema:
regions (alias: rgn)(level, salary, status, code)
customers(value, amount, salary, code)
Task: Find amount from regions where value exceeds the maximum salary from customers for the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14140 | train |
v2 | Schema:
projects (alias: prj)(level, id, date, salary)
categories(id, name, status, value)
Task: Retrieve code from projects that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14141 | train |
v3 | Schema:
employees (alias: emp)(salary, date, id, type)
branches(amount, status, date, type)
Task: Find amount from employees where amount exceeds the minimum salary from branches for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14142 | train |
v2 | Schema:
staff (alias: empl)(value, date, type, amount)
products(amount, status, type, code)
Task: Retrieve id from staff that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14143 | train |
v3 | Schema:
sales (alias: sale)(type, id, code, salary)
transactions(level, salary, status, value)
Task: Find name from sales where value exceeds the maximum salary from transactions for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14144 | train |
v2 | Schema:
items (alias: lne)(status, amount, name, id)
shipments(amount, code, id, salary)
Task: Find value from items where a matching record exists in shipments with the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14145 | train |
v2 | Schema:
branches (alias: brc)(id, level, salary, type)
invoices(level, id, code, salary)
Task: Find value from branches where a matching record exists in invoices with the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14146 | train |
v1 | Schema:
managers (alias: mgr)(type, value, level, name)
transactions(salary, type, amount, status)
Task: Select amount from managers where type exists in transactions for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14147 | train |
v3 | Schema:
invoices (alias: inv)(code, salary, status, name)
requests(level, salary, date, type)
Task: Find id from invoices where value exceeds the maximum amount from requests for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14148 | train |
v3 | Schema:
schedules (alias: schd)(salary, code, type, date)
categories(code, name, type, status)
Task: Find code from schedules where value exceeds the minimum amount from categories for the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE value > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14149 | train |
v2 | Schema:
staff (alias: empl)(name, id, code, type)
departments(type, salary, name, amount)
Task: Find salary from staff where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14150 | train |
v1 | Schema:
projects (alias: prj)(id, level, date, value)
transactions(id, status, value, amount)
Task: Select id from projects where code exists in transactions for the same type.
SQL: | SELECT id FROM projects AS prj
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14151 | train |
v2 | Schema:
tasks (alias: tsk)(salary, status, value, level)
employees(type, status, id, value)
Task: Find id from tasks where a matching record exists in employees with the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14152 | train |
v3 | Schema:
managers (alias: mgr)(amount, type, date, name)
shipments(amount, code, status, id)
Task: Find code from managers where value exceeds the average amount from shipments for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14153 | train |
v1 | Schema:
managers (alias: mgr)(name, value, amount, code)
products(salary, date, type, status)
Task: Find code from managers where type appears in products entries with matching status.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14154 | train |
v3 | Schema:
transactions (alias: txn)(type, id, level, status)
projects(code, value, id, amount)
Task: Find value from transactions where amount exceeds the total amount from projects for the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14155 | train |
v2 | Schema:
transactions (alias: txn)(status, amount, name, salary)
shipments(date, level, value, salary)
Task: Retrieve id from transactions that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14156 | train |
v3 | Schema:
accounts (alias: acct)(code, name, value, amount)
orders(code, id, status, value)
Task: Retrieve id from accounts with value above the COUNT(salary) of orders rows sharing the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14157 | train |
v2 | Schema:
projects (alias: prj)(code, type, id, level)
requests(amount, date, status, level)
Task: Find id from projects where a matching record exists in requests with the same level.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14158 | train |
v1 | Schema:
branches (alias: brc)(type, name, code, amount)
orders(date, salary, amount, value)
Task: Select code from branches where status exists in orders for the same level.
SQL: | SELECT code FROM branches AS brc
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14159 | train |
v1 | Schema:
departments (alias: dept)(date, amount, value, salary)
employees(date, type, amount, id)
Task: Select amount from departments where code exists in employees for the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14160 | train |
v2 | Schema:
managers (alias: mgr)(date, code, type, name)
products(date, salary, amount, level)
Task: Find name from managers where a matching record exists in products with the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14161 | train |
v1 | Schema:
requests (alias: ordr)(date, value, code, salary)
orders(id, name, value, salary)
Task: Retrieve code from requests whose id is found in orders rows where type matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14162 | train |
v2 | Schema:
regions (alias: rgn)(id, amount, status, date)
sales(salary, id, name, status)
Task: Find id from regions where a matching record exists in sales with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14163 | train |
v2 | Schema:
categories (alias: catg)(level, status, date, name)
tasks(name, amount, status, value)
Task: Retrieve id from categories that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14164 | train |
v3 | Schema:
regions (alias: rgn)(level, salary, code, id)
products(salary, code, value, date)
Task: Find salary from regions where value exceeds the count of value from products for the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14165 | train |
v2 | Schema:
managers (alias: mgr)(salary, level, name, code)
accounts(level, id, name, type)
Task: Find name from managers where a matching record exists in accounts with the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14166 | train |
v1 | Schema:
products (alias: prod)(name, amount, value, status)
schedules(date, value, amount, salary)
Task: Select value from products where type exists in schedules for the same code.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = prod.code
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14167 | train |
v2 | Schema:
categories (alias: catg)(date, type, amount, salary)
schedules(salary, status, value, date)
Task: Find amount from categories where a matching record exists in schedules with the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14168 | train |
v2 | Schema:
sales (alias: sale)(id, type, status, name)
customers(status, date, code, name)
Task: Retrieve code from sales that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14169 | train |
v1 | Schema:
sales (alias: sale)(level, salary, code, id)
orders(salary, level, amount, code)
Task: Select salary from sales where status exists in orders for the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14170 | train |
v2 | Schema:
shipments (alias: shp)(name, status, id, value)
staff(date, level, code, status)
Task: Find name from shipments where a matching record exists in staff with the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14171 | train |
v1 | Schema:
tasks (alias: tsk)(code, value, amount, name)
departments(level, salary, date, type)
Task: Find id from tasks where id appears in departments entries with matching code.
SQL: | SELECT id FROM tasks AS tsk
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14172 | train |
v1 | Schema:
requests (alias: ordr)(id, name, level, salary)
departments(status, type, code, date)
Task: Find amount from requests where status appears in departments entries with matching type.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14173 | train |
v1 | Schema:
employees (alias: emp)(value, salary, code, status)
schedules(salary, name, value, code)
Task: Select amount from employees where level exists in schedules for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14174 | train |
v3 | Schema:
employees (alias: emp)(amount, type, name, id)
accounts(status, id, salary, type)
Task: Find salary from employees where salary exceeds the count of value from accounts for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14175 | train |
v1 | Schema:
transactions (alias: txn)(level, name, date, id)
categories(id, date, type, name)
Task: Select name from transactions where id exists in categories for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14176 | train |
v2 | Schema:
transactions (alias: txn)(id, name, amount, value)
invoices(id, type, date, salary)
Task: Find salary from transactions where a matching record exists in invoices with the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14177 | train |
v2 | Schema:
sales (alias: sale)(salary, value, amount, level)
items(level, date, status, name)
Task: Find value from sales where a matching record exists in items with the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14178 | train |
v2 | Schema:
sales (alias: sale)(type, code, amount, salary)
shipments(type, amount, code, status)
Task: Retrieve name from sales that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14179 | train |
v1 | Schema:
employees (alias: emp)(date, level, status, amount)
items(level, name, code, date)
Task: Find code from employees where code appears in items entries with matching level.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14180 | train |
v2 | Schema:
customers (alias: cust)(salary, date, level, value)
items(status, name, level, code)
Task: Find value from customers where a matching record exists in items with the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14181 | train |
v1 | Schema:
branches (alias: brc)(date, level, id, status)
items(salary, date, amount, name)
Task: Retrieve amount from branches whose status is found in items rows where type matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14182 | train |
v2 | Schema:
regions (alias: rgn)(value, status, date, salary)
orders(code, amount, salary, value)
Task: Find amount from regions where a matching record exists in orders with the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14183 | train |
v2 | Schema:
items (alias: lne)(value, amount, status, type)
branches(level, name, amount, type)
Task: Retrieve amount from items that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = lne.type
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14184 | train |
v2 | Schema:
branches (alias: brc)(status, salary, value, type)
categories(level, value, id, name)
Task: Find name from branches where a matching record exists in categories with the same type.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14185 | train |
v1 | Schema:
products (alias: prod)(salary, type, id, date)
regions(name, salary, level, status)
Task: Find name from products where status appears in regions entries with matching id.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14186 | train |
v2 | Schema:
transactions (alias: txn)(value, date, amount, type)
employees(id, date, status, amount)
Task: Retrieve name from transactions that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14187 | train |
v3 | Schema:
categories (alias: catg)(name, level, date, value)
items(date, type, salary, value)
Task: Find code from categories where amount exceeds the average amount from items for the same type.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14188 | train |
v1 | Schema:
products (alias: prod)(status, amount, salary, type)
projects(name, value, status, level)
Task: Find id from products where status appears in projects entries with matching id.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.id = prod.id
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14189 | train |
v1 | Schema:
sales (alias: sale)(type, value, status, amount)
tasks(id, salary, code, type)
Task: Select id from sales where code exists in tasks for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14190 | train |
v2 | Schema:
projects (alias: prj)(value, level, type, code)
departments(date, value, name, level)
Task: Retrieve amount from projects that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14191 | train |
v1 | Schema:
schedules (alias: schd)(name, salary, value, amount)
requests(status, value, id, code)
Task: Select salary from schedules where code exists in requests for the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14192 | train |
v2 | Schema:
items (alias: lne)(code, name, type, date)
accounts(type, code, salary, amount)
Task: Find salary from items where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = lne.type
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14193 | train |
v3 | Schema:
customers (alias: cust)(code, level, id, status)
projects(level, date, value, salary)
Task: Retrieve value from customers with value above the MIN(value) of projects rows sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14194 | train |
v3 | Schema:
regions (alias: rgn)(status, name, salary, level)
staff(type, status, salary, code)
Task: Find amount from regions where value exceeds the maximum amount from staff for the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14195 | train |
v1 | Schema:
transactions (alias: txn)(type, amount, date, salary)
shipments(level, date, id, amount)
Task: Select salary from transactions where code exists in shipments for the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14196 | train |
v3 | Schema:
schedules (alias: schd)(status, amount, value, type)
customers(id, level, status, value)
Task: Find salary from schedules where amount exceeds the minimum amount from customers for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14197 | train |
v1 | Schema:
sales (alias: sale)(name, type, id, amount)
tasks(amount, level, code, name)
Task: Select id from sales where id exists in tasks for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14198 | train |
v3 | Schema:
transactions (alias: txn)(code, level, type, id)
schedules(type, name, date, value)
Task: Find amount from transactions where amount exceeds the minimum value from schedules for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.