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:
orders (alias: ord)(salary, name, level, status)
tasks(date, amount, name, value)
Task: Retrieve value from orders that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00300 | train |
v1 | Schema:
projects (alias: prj)(date, id, level, status)
invoices(salary, status, name, date)
Task: Retrieve name from projects whose code is found in invoices rows where level matches the outer record.
SQL: | SELECT name FROM projects AS prj
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00301 | train |
v1 | Schema:
shipments (alias: shp)(type, salary, level, date)
staff(salary, status, id, code)
Task: Retrieve code from shipments whose status is found in staff rows where level matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00302 | train |
v2 | Schema:
orders (alias: ord)(salary, code, value, level)
requests(salary, date, level, status)
Task: Retrieve salary from orders that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00303 | train |
v1 | Schema:
sales (alias: sale)(amount, value, date, level)
transactions(date, name, id, value)
Task: Find amount from sales where code appears in transactions entries with matching status.
SQL: | SELECT amount FROM sales AS sale
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00304 | train |
v1 | Schema:
staff (alias: empl)(type, id, status, date)
projects(date, amount, type, name)
Task: Find code from staff where status appears in projects entries with matching status.
SQL: | SELECT code FROM staff AS empl
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00305 | train |
v3 | Schema:
accounts (alias: acct)(salary, type, level, value)
employees(name, amount, code, status)
Task: Retrieve code from accounts with amount above the COUNT(value) of employees rows sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00306 | train |
v1 | Schema:
categories (alias: catg)(name, type, amount, status)
orders(value, id, status, amount)
Task: Retrieve name from categories whose level is found in orders rows where type matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00307 | train |
v1 | Schema:
schedules (alias: schd)(name, value, level, type)
categories(status, name, value, salary)
Task: Retrieve code from schedules whose code is found in categories rows where level matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00308 | train |
v1 | Schema:
products (alias: prod)(level, code, id, date)
sales(name, id, code, date)
Task: Find value from products where level appears in sales entries with matching code.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00309 | train |
v2 | Schema:
sales (alias: sale)(type, amount, name, date)
departments(name, salary, level, date)
Task: Find salary from sales where a matching record exists in departments with the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00310 | train |
v1 | Schema:
accounts (alias: acct)(level, value, code, name)
projects(level, status, amount, salary)
Task: Select code from accounts where id exists in projects for the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00311 | train |
v2 | Schema:
orders (alias: ord)(value, type, amount, date)
products(status, id, level, code)
Task: Retrieve id from orders that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00312 | train |
v2 | Schema:
regions (alias: rgn)(id, name, amount, date)
schedules(amount, type, name, status)
Task: Retrieve value from regions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00313 | train |
v2 | Schema:
orders (alias: ord)(code, name, value, status)
departments(code, status, name, id)
Task: Find id from orders where a matching record exists in departments with the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00314 | train |
v2 | Schema:
departments (alias: dept)(id, level, code, amount)
staff(value, name, code, amount)
Task: Find amount from departments where a matching record exists in staff with the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00315 | train |
v2 | Schema:
invoices (alias: inv)(value, status, code, amount)
accounts(salary, code, value, name)
Task: Find salary from invoices where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00316 | train |
v1 | Schema:
items (alias: lne)(amount, id, level, name)
requests(level, status, type, date)
Task: Retrieve name from items whose status is found in requests rows where level matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00317 | train |
v1 | Schema:
products (alias: prod)(type, date, code, id)
managers(code, date, id, amount)
Task: Select value from products where id exists in managers for the same code.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00318 | train |
v1 | Schema:
projects (alias: prj)(level, type, id, name)
transactions(date, id, code, salary)
Task: Retrieve salary from projects whose code is found in transactions rows where id matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00319 | train |
v2 | Schema:
transactions (alias: txn)(code, date, status, name)
accounts(level, type, amount, salary)
Task: Retrieve salary from transactions that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00320 | train |
v2 | Schema:
invoices (alias: inv)(name, type, value, code)
transactions(value, name, type, date)
Task: Retrieve id from invoices that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00321 | train |
v1 | Schema:
sales (alias: sale)(code, level, status, date)
products(status, code, date, id)
Task: Retrieve salary from sales whose level is found in products rows where type matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00322 | train |
v1 | Schema:
projects (alias: prj)(id, type, status, date)
sales(date, status, level, type)
Task: Select code from projects where code exists in sales for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00323 | train |
v1 | Schema:
schedules (alias: schd)(value, amount, code, salary)
categories(value, date, type, status)
Task: Select id from schedules where code exists in categories for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00324 | train |
v2 | Schema:
shipments (alias: shp)(level, type, code, id)
requests(value, name, code, level)
Task: Find name from shipments where a matching record exists in requests with the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00325 | train |
v2 | Schema:
departments (alias: dept)(type, date, code, value)
requests(amount, type, code, salary)
Task: Find salary from departments where a matching record exists in requests with the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00326 | train |
v2 | Schema:
employees (alias: emp)(level, name, value, type)
invoices(date, name, id, amount)
Task: Retrieve amount from employees that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00327 | train |
v3 | Schema:
schedules (alias: schd)(amount, type, name, value)
categories(status, code, level, name)
Task: Retrieve salary from schedules with salary above the COUNT(amount) of categories rows sharing the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00328 | train |
v1 | Schema:
customers (alias: cust)(level, salary, status, value)
transactions(value, date, type, level)
Task: Retrieve amount from customers whose status is found in transactions rows where code matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00329 | train |
v3 | Schema:
transactions (alias: txn)(salary, status, type, id)
requests(date, id, level, status)
Task: Find salary from transactions where salary exceeds the average salary from requests for the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00330 | train |
v3 | Schema:
employees (alias: emp)(value, salary, id, level)
products(date, code, type, salary)
Task: Find amount from employees where salary exceeds the minimum salary from products for the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00331 | train |
v3 | Schema:
items (alias: lne)(salary, type, value, amount)
customers(id, value, date, type)
Task: Retrieve salary from items with salary above the MIN(salary) of customers rows sharing the same type.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00332 | train |
v3 | Schema:
tasks (alias: tsk)(amount, value, date, status)
shipments(code, amount, name, value)
Task: Retrieve amount from tasks with amount above the SUM(amount) of shipments rows sharing the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00333 | train |
v3 | Schema:
managers (alias: mgr)(level, amount, name, code)
orders(type, id, salary, status)
Task: Find id from managers where value exceeds the maximum salary from orders for the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00334 | train |
v1 | Schema:
products (alias: prod)(id, amount, code, name)
invoices(code, id, salary, level)
Task: Select code from products where id exists in invoices for the same id.
SQL: | SELECT code FROM products AS prod
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = prod.id
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00335 | train |
v1 | Schema:
requests (alias: ordr)(type, date, code, status)
sales(code, status, salary, name)
Task: Retrieve salary from requests whose id is found in sales rows where status matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00336 | train |
v3 | Schema:
employees (alias: emp)(status, amount, name, date)
transactions(type, amount, status, level)
Task: Retrieve salary from employees with amount above the COUNT(amount) of transactions rows sharing the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00337 | train |
v1 | Schema:
accounts (alias: acct)(id, type, value, status)
orders(status, id, value, salary)
Task: Select salary from accounts where level exists in orders for the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00338 | train |
v1 | Schema:
schedules (alias: schd)(salary, type, date, value)
tasks(type, salary, status, name)
Task: Retrieve name from schedules whose id is found in tasks rows where code matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00339 | train |
v1 | Schema:
requests (alias: ordr)(date, salary, type, level)
staff(level, date, amount, type)
Task: Retrieve name from requests whose code is found in staff rows where type matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00340 | train |
v3 | Schema:
regions (alias: rgn)(level, value, date, amount)
managers(amount, salary, level, code)
Task: Find name from regions where amount exceeds the average value from managers for the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00341 | train |
v2 | Schema:
projects (alias: prj)(status, level, type, name)
managers(date, amount, salary, id)
Task: Retrieve name from projects that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00342 | train |
v2 | Schema:
invoices (alias: inv)(date, value, amount, salary)
categories(amount, name, status, id)
Task: Retrieve id from invoices that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00343 | train |
v2 | Schema:
customers (alias: cust)(salary, value, id, status)
shipments(name, type, id, date)
Task: Find value from customers where a matching record exists in shipments with the same status.
SQL: | SELECT value 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": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00344 | train |
v2 | Schema:
customers (alias: cust)(status, name, type, code)
staff(code, level, value, salary)
Task: Find code from customers where a matching record exists in staff with the same code.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00345 | train |
v1 | Schema:
departments (alias: dept)(amount, salary, name, date)
regions(type, code, date, salary)
Task: Select id from departments where code exists in regions for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00346 | train |
v1 | Schema:
accounts (alias: acct)(amount, code, salary, id)
tasks(amount, level, name, value)
Task: Find name from accounts where status appears in tasks entries with matching type.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00347 | train |
v2 | Schema:
employees (alias: emp)(amount, type, salary, value)
categories(salary, level, name, date)
Task: Find name from employees where a matching record exists in categories with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00348 | train |
v1 | Schema:
products (alias: prod)(status, salary, id, date)
items(salary, date, name, code)
Task: Find id from products where status appears in items entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = prod.code
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00349 | train |
v1 | Schema:
departments (alias: dept)(amount, date, name, id)
shipments(value, amount, name, code)
Task: Retrieve salary from departments whose type is found in shipments rows where status matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00350 | train |
v2 | Schema:
products (alias: prod)(salary, id, name, level)
accounts(status, value, name, level)
Task: Retrieve amount from products that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00351 | train |
v3 | Schema:
shipments (alias: shp)(salary, status, amount, level)
sales(code, salary, id, amount)
Task: Find value from shipments where value exceeds the total amount from sales for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00352 | train |
v2 | Schema:
staff (alias: empl)(salary, status, code, amount)
schedules(value, date, status, id)
Task: Retrieve code from staff that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00353 | train |
v1 | Schema:
branches (alias: brc)(level, date, status, id)
customers(status, amount, type, salary)
Task: Retrieve value from branches whose level is found in customers rows where id matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00354 | train |
v3 | Schema:
customers (alias: cust)(name, amount, type, date)
employees(amount, id, type, value)
Task: Retrieve name from customers with amount above the MAX(value) of employees rows sharing the same type.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00355 | train |
v1 | Schema:
categories (alias: catg)(level, type, code, status)
branches(name, amount, type, date)
Task: Retrieve value from categories whose id is found in branches rows where level matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00356 | train |
v1 | Schema:
regions (alias: rgn)(value, amount, status, date)
items(date, amount, salary, type)
Task: Find id from regions where code appears in items entries with matching level.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00357 | train |
v1 | Schema:
orders (alias: ord)(status, amount, value, id)
tasks(name, id, value, salary)
Task: Retrieve salary from orders whose code is found in tasks rows where status matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00358 | train |
v3 | Schema:
categories (alias: catg)(name, status, level, amount)
transactions(value, salary, amount, status)
Task: Find salary from categories where salary exceeds the total amount from transactions for the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00359 | train |
v2 | Schema:
departments (alias: dept)(status, type, date, amount)
branches(id, type, level, name)
Task: Find name from departments where a matching record exists in branches with the same type.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00360 | train |
v2 | Schema:
employees (alias: emp)(code, type, date, name)
products(name, id, type, code)
Task: Find salary from employees where a matching record exists in products with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00361 | train |
v1 | Schema:
tasks (alias: tsk)(id, code, date, salary)
transactions(amount, name, date, level)
Task: Select id from tasks where level exists in transactions for the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00362 | train |
v1 | Schema:
accounts (alias: acct)(date, status, amount, name)
shipments(code, type, date, level)
Task: Find name from accounts where code appears in shipments entries with matching level.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00363 | train |
v1 | Schema:
transactions (alias: txn)(name, date, type, level)
employees(name, type, date, amount)
Task: Retrieve code from transactions whose status is found in employees rows where code matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00364 | train |
v3 | Schema:
schedules (alias: schd)(value, amount, status, id)
managers(date, value, status, name)
Task: Retrieve salary from schedules with salary above the MAX(value) of managers rows sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00365 | train |
v3 | Schema:
branches (alias: brc)(level, code, type, value)
shipments(level, code, value, type)
Task: Find value from branches where amount exceeds the maximum value from shipments for the same code.
SQL: | SELECT value FROM branches AS brc
WHERE amount > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00366 | train |
v3 | Schema:
projects (alias: prj)(salary, date, code, status)
departments(date, id, salary, name)
Task: Retrieve salary from projects with amount above the MAX(value) of departments rows sharing the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00367 | train |
v2 | Schema:
tasks (alias: tsk)(type, status, date, id)
invoices(level, code, date, amount)
Task: Find value from tasks where a matching record exists in invoices with the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00368 | train |
v2 | Schema:
employees (alias: emp)(code, name, value, salary)
customers(amount, code, value, name)
Task: Find name from employees where a matching record exists in customers with the same code.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00369 | train |
v1 | Schema:
employees (alias: emp)(id, level, code, salary)
accounts(amount, id, value, salary)
Task: Select id from employees where level exists in accounts for the same type.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00370 | train |
v1 | Schema:
items (alias: lne)(date, type, level, code)
staff(type, id, value, date)
Task: Retrieve code from items whose level is found in staff rows where level matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.level = lne.level
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00371 | train |
v1 | Schema:
regions (alias: rgn)(id, level, name, date)
shipments(amount, type, value, date)
Task: Find value from regions where level appears in shipments entries with matching id.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00372 | train |
v2 | Schema:
shipments (alias: shp)(date, name, code, level)
managers(type, value, code, level)
Task: Retrieve amount from shipments that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00373 | train |
v1 | Schema:
sales (alias: sale)(level, id, amount, status)
transactions(value, status, id, salary)
Task: Select amount from sales where type exists in transactions for the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00374 | train |
v1 | Schema:
accounts (alias: acct)(date, amount, code, status)
shipments(date, value, type, code)
Task: Find name from accounts where code appears in shipments entries with matching type.
SQL: | SELECT name FROM accounts AS acct
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00375 | train |
v2 | Schema:
categories (alias: catg)(level, amount, value, type)
invoices(salary, code, date, level)
Task: Find amount from categories where a matching record exists in invoices with the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00376 | train |
v2 | Schema:
accounts (alias: acct)(type, value, level, salary)
requests(code, amount, date, value)
Task: Retrieve amount from accounts that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00377 | train |
v3 | Schema:
schedules (alias: schd)(date, status, amount, code)
tasks(amount, name, salary, code)
Task: Retrieve salary from schedules with salary above the MAX(amount) of tasks rows sharing the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00378 | train |
v3 | Schema:
managers (alias: mgr)(value, name, id, amount)
products(date, salary, code, name)
Task: Retrieve id from managers with value above the AVG(salary) of products rows sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT AVG(salary) FROM products AS prod
WHERE prod.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00379 | train |
v3 | Schema:
items (alias: lne)(name, id, salary, level)
accounts(amount, id, level, name)
Task: Retrieve amount from items with salary above the COUNT(salary) of accounts rows sharing the same status.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00380 | train |
v3 | Schema:
managers (alias: mgr)(value, date, id, salary)
invoices(salary, value, amount, type)
Task: Retrieve code from managers with amount above the AVG(value) of invoices rows sharing the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00381 | train |
v2 | Schema:
requests (alias: ordr)(date, id, level, status)
projects(date, salary, amount, id)
Task: Find id from requests where a matching record exists in projects with the same status.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00382 | train |
v1 | Schema:
regions (alias: rgn)(type, name, level, date)
managers(code, value, name, salary)
Task: Find value from regions where status appears in managers entries with matching id.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00383 | train |
v3 | Schema:
staff (alias: empl)(salary, value, level, id)
managers(type, name, level, id)
Task: Find name from staff where salary exceeds the maximum salary from managers for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00384 | train |
v1 | Schema:
items (alias: lne)(name, salary, type, id)
accounts(id, code, status, amount)
Task: Select code from items where level exists in accounts for the same level.
SQL: | SELECT code FROM items AS lne
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00385 | train |
v1 | Schema:
accounts (alias: acct)(salary, status, amount, date)
staff(level, status, id, type)
Task: Select id from accounts where id exists in staff for the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00386 | train |
v3 | Schema:
tasks (alias: tsk)(id, salary, value, name)
customers(status, code, id, type)
Task: Find value from tasks where amount exceeds the minimum amount from customers for the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00387 | train |
v2 | Schema:
sales (alias: sale)(value, code, status, name)
items(amount, name, salary, status)
Task: Find amount from sales where a matching record exists in items with the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00388 | train |
v1 | Schema:
branches (alias: brc)(date, level, type, status)
accounts(type, level, code, value)
Task: Retrieve name from branches whose type is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00389 | train |
v2 | Schema:
transactions (alias: txn)(type, date, value, salary)
orders(name, code, id, status)
Task: Retrieve code from transactions that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00390 | train |
v3 | Schema:
invoices (alias: inv)(date, status, name, amount)
categories(amount, type, name, status)
Task: Find code from invoices where amount exceeds the count of amount from categories for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00391 | train |
v1 | Schema:
departments (alias: dept)(salary, amount, status, code)
items(amount, name, date, status)
Task: Find code from departments where status appears in items entries with matching type.
SQL: | SELECT code FROM departments AS dept
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00392 | train |
v2 | Schema:
managers (alias: mgr)(date, salary, status, code)
branches(id, date, type, status)
Task: Find salary from managers where a matching record exists in branches with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00393 | train |
v3 | Schema:
departments (alias: dept)(amount, date, code, type)
branches(status, name, date, type)
Task: Find code from departments where value exceeds the total salary from branches for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00394 | train |
v3 | Schema:
staff (alias: empl)(id, code, type, level)
customers(code, level, date, amount)
Task: Find code from staff where amount exceeds the maximum value from customers for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00395 | train |
v1 | Schema:
transactions (alias: txn)(name, status, id, date)
regions(salary, date, type, value)
Task: Retrieve id from transactions whose code is found in regions rows where status matches the outer record.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00396 | train |
v2 | Schema:
requests (alias: ordr)(name, id, salary, level)
projects(type, value, id, name)
Task: Find amount from requests where a matching record exists in projects with the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00397 | train |
v3 | Schema:
staff (alias: empl)(id, date, level, name)
departments(date, status, name, type)
Task: Retrieve salary from staff with amount above the SUM(amount) of departments rows sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00398 | train |
v3 | Schema:
projects (alias: prj)(status, id, amount, date)
departments(amount, date, value, status)
Task: Find salary from projects where salary exceeds the maximum value from departments for the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.