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:
requests (alias: ordr)(amount, salary, level, name)
departments(date, name, status, amount)
Task: Find code from requests where value exceeds the total salary from departments for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15900 | train |
v2 | Schema:
customers (alias: cust)(status, code, value, date)
categories(id, name, amount, salary)
Task: Retrieve id from customers that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15901 | train |
v3 | Schema:
orders (alias: ord)(id, level, salary, code)
sales(id, salary, code, type)
Task: Retrieve name from orders with value above the MAX(amount) of sales rows sharing the same id.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15902 | train |
v2 | Schema:
invoices (alias: inv)(id, salary, status, type)
requests(amount, salary, code, date)
Task: Retrieve code from invoices that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15903 | train |
v1 | Schema:
invoices (alias: inv)(value, date, salary, level)
transactions(amount, value, code, id)
Task: Select amount from invoices where status exists in transactions for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15904 | train |
v1 | Schema:
accounts (alias: acct)(salary, date, value, id)
departments(type, id, name, code)
Task: Find code from accounts where type appears in departments entries with matching code.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15905 | train |
v2 | Schema:
sales (alias: sale)(date, status, amount, salary)
products(salary, code, date, id)
Task: Find value from sales where a matching record exists in products with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15906 | train |
v1 | Schema:
staff (alias: empl)(date, amount, level, status)
schedules(status, amount, code, value)
Task: Find code from staff where code appears in schedules entries with matching status.
SQL: | SELECT code FROM staff AS empl
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15907 | train |
v1 | Schema:
departments (alias: dept)(type, level, salary, code)
branches(salary, id, amount, date)
Task: Select value from departments where type exists in branches for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15908 | train |
v2 | Schema:
accounts (alias: acct)(salary, amount, type, value)
requests(amount, type, level, code)
Task: Retrieve salary from accounts that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15909 | train |
v3 | Schema:
schedules (alias: schd)(date, level, salary, type)
managers(amount, level, type, name)
Task: Retrieve salary from schedules with amount above the MIN(salary) of managers rows sharing the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15910 | train |
v1 | Schema:
categories (alias: catg)(salary, id, value, amount)
sales(type, value, level, date)
Task: Find code from categories where id appears in sales entries with matching level.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15911 | train |
v1 | Schema:
orders (alias: ord)(date, status, amount, level)
schedules(level, name, value, salary)
Task: Find value from orders where status appears in schedules entries with matching code.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15912 | train |
v2 | Schema:
tasks (alias: tsk)(status, code, type, name)
projects(name, level, id, amount)
Task: Retrieve value from tasks that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15913 | train |
v2 | Schema:
schedules (alias: schd)(name, code, type, amount)
staff(name, type, amount, code)
Task: Find id from schedules where a matching record exists in staff with the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15914 | train |
v2 | Schema:
tasks (alias: tsk)(value, level, type, id)
managers(value, status, amount, level)
Task: Retrieve amount from tasks that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15915 | train |
v2 | Schema:
employees (alias: emp)(code, id, status, amount)
schedules(id, value, level, amount)
Task: Find id from employees where a matching record exists in schedules with the same level.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15916 | train |
v2 | Schema:
categories (alias: catg)(id, status, name, amount)
schedules(name, value, amount, salary)
Task: Retrieve id from categories that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15917 | train |
v3 | Schema:
schedules (alias: schd)(status, amount, salary, name)
staff(level, value, salary, id)
Task: Retrieve id from schedules with amount above the MAX(amount) of staff rows sharing the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15918 | train |
v2 | Schema:
departments (alias: dept)(date, salary, level, type)
transactions(code, level, id, type)
Task: Find name from departments where a matching record exists in transactions with the same type.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15919 | train |
v2 | Schema:
categories (alias: catg)(code, amount, value, type)
staff(type, id, status, salary)
Task: Retrieve id from categories that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15920 | train |
v2 | Schema:
categories (alias: catg)(status, level, type, id)
customers(type, name, level, value)
Task: Find salary from categories where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15921 | train |
v1 | Schema:
managers (alias: mgr)(level, date, status, name)
sales(name, salary, code, status)
Task: Select id from managers where type exists in sales for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15922 | train |
v2 | Schema:
staff (alias: empl)(date, id, status, name)
schedules(type, status, salary, name)
Task: Find salary from staff where a matching record exists in schedules with the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15923 | train |
v2 | Schema:
managers (alias: mgr)(level, name, date, id)
schedules(type, date, level, name)
Task: Find amount from managers where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15924 | train |
v1 | Schema:
customers (alias: cust)(status, value, type, name)
items(date, level, salary, type)
Task: Select code from customers where status exists in items for the same code.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15925 | train |
v3 | Schema:
transactions (alias: txn)(id, type, level, status)
products(value, level, salary, name)
Task: Retrieve name from transactions with amount above the SUM(amount) of products rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15926 | train |
v1 | Schema:
departments (alias: dept)(salary, type, value, level)
projects(salary, type, value, id)
Task: Select salary from departments where status exists in projects for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15927 | train |
v2 | Schema:
branches (alias: brc)(amount, salary, status, type)
transactions(id, value, date, amount)
Task: Find value from branches where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15928 | train |
v2 | Schema:
customers (alias: cust)(amount, name, status, date)
tasks(code, name, value, status)
Task: Retrieve value from customers that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15929 | train |
v3 | Schema:
shipments (alias: shp)(code, value, id, name)
items(name, level, type, value)
Task: Retrieve code from shipments with value above the MAX(value) of items rows sharing the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15930 | train |
v3 | Schema:
requests (alias: ordr)(date, amount, value, name)
accounts(salary, name, status, value)
Task: Retrieve value from requests with salary above the SUM(value) of accounts rows sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15931 | train |
v3 | Schema:
customers (alias: cust)(salary, type, level, name)
accounts(salary, amount, type, status)
Task: Retrieve name from customers with salary above the AVG(value) of accounts rows sharing the same id.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15932 | train |
v2 | Schema:
regions (alias: rgn)(date, level, id, amount)
categories(status, salary, type, level)
Task: Find amount from regions where a matching record exists in categories with the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15933 | train |
v1 | Schema:
projects (alias: prj)(value, salary, date, code)
sales(level, status, date, value)
Task: Retrieve id from projects whose code is found in sales rows where code matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15934 | train |
v2 | Schema:
departments (alias: dept)(id, code, salary, amount)
orders(value, id, amount, name)
Task: Retrieve value from departments that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15935 | train |
v3 | Schema:
requests (alias: ordr)(salary, value, id, amount)
regions(code, type, id, value)
Task: Find code from requests where salary exceeds the minimum salary from regions for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15936 | train |
v2 | Schema:
schedules (alias: schd)(level, name, date, status)
projects(code, value, type, salary)
Task: Find salary from schedules where a matching record exists in projects with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15937 | train |
v3 | Schema:
transactions (alias: txn)(value, type, id, amount)
accounts(date, level, type, salary)
Task: Retrieve code from transactions with salary above the COUNT(salary) of accounts rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15938 | train |
v3 | Schema:
employees (alias: emp)(level, salary, status, name)
items(status, salary, code, name)
Task: Find amount from employees where value exceeds the total amount from items for the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15939 | train |
v3 | Schema:
departments (alias: dept)(code, name, type, date)
managers(type, salary, date, code)
Task: Retrieve name from departments with salary above the SUM(value) of managers rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15940 | train |
v1 | Schema:
requests (alias: ordr)(salary, amount, id, code)
sales(id, salary, code, value)
Task: Retrieve name from requests whose id is found in sales rows where id matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15941 | train |
v3 | Schema:
schedules (alias: schd)(level, status, value, salary)
products(date, level, salary, amount)
Task: Retrieve code from schedules with amount above the AVG(value) of products rows sharing the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT AVG(value) FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15942 | train |
v1 | Schema:
transactions (alias: txn)(salary, code, level, status)
employees(salary, level, type, code)
Task: Select value from transactions where level exists in employees for the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15943 | train |
v2 | Schema:
products (alias: prod)(value, status, type, date)
regions(date, type, code, id)
Task: Retrieve name from products that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15944 | train |
v2 | Schema:
schedules (alias: schd)(status, date, value, type)
requests(type, status, id, value)
Task: Retrieve code from schedules that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15945 | train |
v1 | Schema:
projects (alias: prj)(date, code, amount, value)
employees(date, status, code, amount)
Task: Retrieve code from projects whose level is found in employees rows where level matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15946 | train |
v2 | Schema:
projects (alias: prj)(code, name, type, id)
orders(value, amount, salary, type)
Task: Find amount from projects where a matching record exists in orders with the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15947 | train |
v2 | Schema:
staff (alias: empl)(level, date, status, code)
accounts(amount, value, level, date)
Task: Find value from staff where a matching record exists in accounts with the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15948 | train |
v2 | Schema:
invoices (alias: inv)(salary, id, type, level)
requests(type, code, level, name)
Task: Find salary from invoices where a matching record exists in requests with the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15949 | train |
v1 | Schema:
transactions (alias: txn)(level, date, type, code)
schedules(status, amount, level, id)
Task: Select value from transactions where status exists in schedules for the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15950 | train |
v3 | Schema:
items (alias: lne)(amount, status, type, id)
staff(id, date, type, value)
Task: Retrieve id from items with salary above the MAX(salary) of staff rows sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE salary > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15951 | train |
v2 | Schema:
departments (alias: dept)(type, code, level, id)
sales(id, name, status, value)
Task: Retrieve amount from departments that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15952 | train |
v1 | Schema:
branches (alias: brc)(id, date, value, status)
transactions(salary, type, id, name)
Task: Find id from branches where type appears in transactions entries with matching id.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15953 | train |
v2 | Schema:
staff (alias: empl)(id, date, amount, code)
regions(id, code, name, level)
Task: Retrieve name from staff that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15954 | train |
v2 | Schema:
managers (alias: mgr)(code, date, name, value)
requests(amount, code, name, type)
Task: Find code from managers where a matching record exists in requests with the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15955 | train |
v1 | Schema:
categories (alias: catg)(level, name, type, salary)
orders(name, level, date, id)
Task: Select salary from categories where id exists in orders for the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15956 | train |
v2 | Schema:
employees (alias: emp)(id, value, level, salary)
sales(name, amount, date, code)
Task: Retrieve name from employees that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15957 | train |
v1 | Schema:
invoices (alias: inv)(type, code, amount, status)
categories(amount, salary, status, level)
Task: Retrieve name from invoices whose status is found in categories rows where id matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15958 | train |
v2 | Schema:
shipments (alias: shp)(code, salary, level, date)
invoices(date, name, amount, value)
Task: Find amount from shipments where a matching record exists in invoices with the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15959 | train |
v2 | Schema:
staff (alias: empl)(type, id, amount, status)
requests(date, amount, level, type)
Task: Retrieve code from staff that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_15960 | train |
v2 | Schema:
orders (alias: ord)(date, amount, salary, type)
invoices(amount, type, id, value)
Task: Find value from orders where a matching record exists in invoices with the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15961 | train |
v1 | Schema:
tasks (alias: tsk)(level, date, amount, status)
requests(amount, value, salary, level)
Task: Select amount from tasks where code exists in requests for the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15962 | train |
v3 | Schema:
sales (alias: sale)(salary, code, id, date)
categories(type, name, level, code)
Task: Find name from sales where amount exceeds the count of salary from categories for the same level.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15963 | train |
v2 | Schema:
invoices (alias: inv)(value, salary, id, level)
schedules(salary, amount, id, level)
Task: Find amount from invoices where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15964 | train |
v1 | Schema:
branches (alias: brc)(value, salary, level, status)
managers(code, value, status, amount)
Task: Find salary from branches where code appears in managers entries with matching level.
SQL: | SELECT salary FROM branches AS brc
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15965 | train |
v1 | Schema:
requests (alias: ordr)(code, date, value, level)
invoices(amount, level, date, id)
Task: Retrieve name from requests whose id is found in invoices rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15966 | train |
v3 | Schema:
tasks (alias: tsk)(salary, type, value, level)
accounts(code, name, status, level)
Task: Find name from tasks where amount exceeds the minimum value from accounts for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE amount > (
SELECT MIN(value) FROM accounts AS acct
WHERE acct.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_15967 | train |
v3 | Schema:
branches (alias: brc)(code, amount, value, date)
schedules(level, date, status, code)
Task: Retrieve value from branches with value above the SUM(amount) of schedules rows sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15968 | train |
v2 | Schema:
customers (alias: cust)(level, id, name, type)
managers(name, date, id, amount)
Task: Find id from customers where a matching record exists in managers with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15969 | train |
v3 | Schema:
customers (alias: cust)(code, name, level, salary)
categories(id, code, status, type)
Task: Find id from customers where amount exceeds the count of salary from categories for the same type.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15970 | train |
v1 | Schema:
projects (alias: prj)(id, level, date, name)
accounts(status, id, code, amount)
Task: Select name from projects where level exists in accounts for the same type.
SQL: | SELECT name FROM projects AS prj
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15971 | train |
v2 | Schema:
schedules (alias: schd)(salary, status, type, level)
accounts(id, code, value, status)
Task: Retrieve value from schedules that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15972 | train |
v3 | Schema:
requests (alias: ordr)(amount, value, code, salary)
items(code, level, date, status)
Task: Find code from requests where amount exceeds the average value from items for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15973 | train |
v3 | Schema:
managers (alias: mgr)(status, date, id, level)
sales(type, amount, salary, level)
Task: Retrieve code from managers with amount above the COUNT(amount) of sales rows sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15974 | train |
v1 | Schema:
items (alias: lne)(amount, level, code, salary)
transactions(level, salary, date, amount)
Task: Select name from items where id exists in transactions for the same level.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15975 | train |
v1 | Schema:
projects (alias: prj)(date, level, amount, value)
sales(type, date, status, level)
Task: Find value from projects where status appears in sales entries with matching code.
SQL: | SELECT value FROM projects AS prj
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15976 | train |
v1 | Schema:
invoices (alias: inv)(name, amount, type, level)
tasks(code, id, salary, type)
Task: Select id from invoices where status exists in tasks for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15977 | train |
v1 | Schema:
employees (alias: emp)(level, salary, date, status)
accounts(status, code, value, name)
Task: Retrieve salary from employees whose type is found in accounts rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15978 | train |
v1 | Schema:
transactions (alias: txn)(value, level, salary, id)
requests(value, status, name, level)
Task: Select id from transactions where id exists in requests for the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15979 | train |
v2 | Schema:
transactions (alias: txn)(value, id, amount, level)
regions(amount, date, id, name)
Task: Find salary from transactions where a matching record exists in regions with the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15980 | train |
v2 | Schema:
categories (alias: catg)(date, amount, level, status)
requests(level, name, code, id)
Task: Retrieve salary from categories that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_15981 | train |
v3 | Schema:
items (alias: lne)(type, level, id, status)
sales(type, value, date, name)
Task: Find id from items where amount exceeds the average amount from sales for the same id.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.id = lne.id
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15982 | train |
v3 | Schema:
invoices (alias: inv)(value, status, amount, date)
products(level, salary, date, amount)
Task: Retrieve amount from invoices with salary above the MAX(amount) of products rows sharing the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15983 | train |
v3 | Schema:
departments (alias: dept)(status, level, code, amount)
accounts(date, salary, name, status)
Task: Retrieve code from departments with amount above the SUM(value) of accounts rows sharing the same type.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15984 | train |
v2 | Schema:
invoices (alias: inv)(value, status, name, type)
projects(value, amount, name, date)
Task: Retrieve id from invoices that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15985 | train |
v1 | Schema:
orders (alias: ord)(status, date, code, value)
products(level, amount, id, date)
Task: Retrieve amount from orders whose id is found in products rows where code matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15986 | train |
v2 | Schema:
sales (alias: sale)(date, status, salary, amount)
transactions(name, salary, code, date)
Task: Retrieve amount from sales that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15987 | train |
v3 | Schema:
regions (alias: rgn)(name, amount, status, level)
customers(amount, status, type, salary)
Task: Retrieve id from regions with value above the SUM(value) of customers rows sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_15988 | train |
v3 | Schema:
shipments (alias: shp)(amount, id, level, salary)
orders(id, code, date, status)
Task: Retrieve value from shipments with value above the COUNT(value) of orders rows sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15989 | train |
v3 | Schema:
departments (alias: dept)(value, name, status, salary)
tasks(type, salary, date, status)
Task: Retrieve salary from departments with salary above the MAX(value) of tasks rows sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15990 | train |
v2 | Schema:
projects (alias: prj)(amount, name, id, date)
transactions(value, salary, status, level)
Task: Find salary from projects where a matching record exists in transactions with the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_15991 | train |
v3 | Schema:
customers (alias: cust)(status, amount, type, code)
products(name, code, value, amount)
Task: Retrieve amount from customers with amount above the MIN(amount) of products rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15992 | train |
v1 | Schema:
requests (alias: ordr)(name, amount, salary, value)
regions(id, date, salary, value)
Task: Select amount from requests where status exists in regions for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_15993 | train |
v2 | Schema:
employees (alias: emp)(salary, id, type, name)
customers(amount, code, level, date)
Task: Retrieve code from employees that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15994 | train |
v3 | Schema:
shipments (alias: shp)(value, type, status, date)
branches(amount, status, value, code)
Task: Find value from shipments where amount exceeds the total salary from branches for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_15995 | train |
v3 | Schema:
items (alias: lne)(level, code, salary, value)
branches(name, date, type, code)
Task: Find amount from items where value exceeds the total value from branches for the same level.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_15996 | train |
v2 | Schema:
orders (alias: ord)(date, id, status, name)
categories(id, amount, type, value)
Task: Find id from orders where a matching record exists in categories with the same level.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15997 | train |
v1 | Schema:
products (alias: prod)(date, salary, level, code)
orders(type, level, code, id)
Task: Retrieve amount from products whose status is found in orders rows where level matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = prod.level
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_15998 | train |
v2 | Schema:
branches (alias: brc)(type, name, id, status)
accounts(code, type, id, name)
Task: Retrieve salary from branches that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_15999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.