variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
schedules (alias: schd)(level, name, salary, id)
items(type, amount, code, value)
Task: Retrieve code from schedules whose status is found in items rows where code matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14000 | train |
v2 | Schema:
regions (alias: rgn)(status, value, salary, type)
products(name, date, salary, id)
Task: Retrieve value from regions that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14001 | train |
v2 | Schema:
regions (alias: rgn)(value, level, status, code)
requests(id, value, status, salary)
Task: Retrieve salary from regions that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14002 | train |
v2 | Schema:
transactions (alias: txn)(name, id, amount, status)
tasks(name, type, amount, status)
Task: Find id from transactions where a matching record exists in tasks with the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14003 | train |
v2 | Schema:
categories (alias: catg)(value, name, type, code)
branches(code, date, value, id)
Task: Find name from categories where a matching record exists in branches with the same status.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14004 | train |
v2 | Schema:
sales (alias: sale)(type, value, amount, name)
regions(id, date, type, amount)
Task: Find name from sales where a matching record exists in regions with the same type.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14005 | train |
v2 | Schema:
sales (alias: sale)(status, level, salary, amount)
regions(status, date, id, amount)
Task: Find name from sales where a matching record exists in regions with the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14006 | train |
v1 | Schema:
managers (alias: mgr)(date, salary, code, status)
regions(amount, name, level, date)
Task: Retrieve salary from managers whose id is found in regions rows where level matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14007 | train |
v3 | Schema:
transactions (alias: txn)(date, id, level, value)
managers(status, type, name, salary)
Task: Find amount from transactions where value exceeds the average salary from managers for the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14008 | train |
v2 | Schema:
departments (alias: dept)(amount, date, code, salary)
products(date, status, amount, type)
Task: Retrieve name from departments that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14009 | train |
v2 | Schema:
transactions (alias: txn)(level, value, status, amount)
invoices(salary, amount, name, id)
Task: Find salary from transactions where a matching record exists in invoices with the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14010 | train |
v3 | Schema:
accounts (alias: acct)(value, code, name, amount)
managers(name, date, type, amount)
Task: Find value from accounts where amount exceeds the maximum salary from managers for the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14011 | train |
v3 | Schema:
regions (alias: rgn)(salary, value, name, date)
items(id, status, salary, amount)
Task: Find code from regions where salary exceeds the average value from items for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT AVG(value) FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14012 | train |
v3 | Schema:
transactions (alias: txn)(type, amount, code, value)
branches(level, code, salary, value)
Task: Retrieve salary from transactions with amount above the SUM(amount) of branches rows sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14013 | train |
v3 | Schema:
branches (alias: brc)(salary, amount, status, value)
sales(level, date, amount, name)
Task: Retrieve value from branches with amount above the AVG(salary) of sales rows sharing the same status.
SQL: | SELECT value FROM branches AS brc
WHERE amount > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14014 | train |
v2 | Schema:
tasks (alias: tsk)(status, level, name, salary)
staff(amount, id, type, date)
Task: Retrieve salary from tasks that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14015 | train |
v3 | Schema:
items (alias: lne)(type, level, id, date)
invoices(date, name, level, amount)
Task: Retrieve code from items with amount above the MAX(salary) of invoices rows sharing the same id.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14016 | train |
v2 | Schema:
projects (alias: prj)(type, value, amount, id)
products(type, level, id, code)
Task: Retrieve code from projects that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14017 | train |
v1 | Schema:
orders (alias: ord)(id, value, date, salary)
items(type, id, date, level)
Task: Find name from orders where code appears in items entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14018 | train |
v1 | Schema:
branches (alias: brc)(value, date, type, code)
items(type, name, level, id)
Task: Find value from branches where level appears in items entries with matching level.
SQL: | SELECT value FROM branches AS brc
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14019 | train |
v1 | Schema:
employees (alias: emp)(date, amount, name, value)
products(code, name, status, type)
Task: Find name from employees where code appears in products entries with matching code.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14020 | train |
v2 | Schema:
accounts (alias: acct)(date, level, id, name)
products(date, status, amount, level)
Task: Find salary from accounts where a matching record exists in products with the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14021 | train |
v1 | Schema:
customers (alias: cust)(type, name, amount, level)
categories(name, date, type, salary)
Task: Retrieve value from customers whose code is found in categories rows where type matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14022 | train |
v3 | Schema:
customers (alias: cust)(salary, level, id, status)
products(type, name, status, salary)
Task: Find value from customers where amount exceeds the maximum amount from products for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14023 | train |
v2 | Schema:
invoices (alias: inv)(date, code, id, salary)
managers(amount, value, salary, code)
Task: Find value from invoices where a matching record exists in managers with the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14024 | train |
v3 | Schema:
accounts (alias: acct)(status, value, date, name)
products(name, id, type, date)
Task: Retrieve code from accounts with salary above the MIN(value) of products rows sharing the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14025 | train |
v2 | Schema:
accounts (alias: acct)(name, id, status, date)
categories(level, date, type, id)
Task: Retrieve name from accounts that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14026 | train |
v3 | Schema:
departments (alias: dept)(code, name, value, level)
categories(salary, value, id, level)
Task: Find id from departments where amount exceeds the average value from categories for the same code.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14027 | train |
v1 | Schema:
transactions (alias: txn)(status, code, salary, name)
projects(date, name, level, amount)
Task: Retrieve name from transactions whose type is found in projects rows where type matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14028 | train |
v3 | Schema:
orders (alias: ord)(date, name, amount, id)
customers(type, status, date, name)
Task: Retrieve amount from orders with value above the MAX(amount) of customers rows sharing the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "amount",
"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_14029 | train |
v2 | Schema:
regions (alias: rgn)(amount, status, type, level)
schedules(level, status, name, amount)
Task: Find salary from regions where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14030 | train |
v1 | Schema:
tasks (alias: tsk)(salary, status, date, id)
regions(salary, value, status, type)
Task: Select salary from tasks where type exists in regions for the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14031 | train |
v1 | Schema:
staff (alias: empl)(code, type, salary, value)
categories(date, salary, status, amount)
Task: Find value from staff where type appears in categories entries with matching code.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14032 | train |
v3 | Schema:
managers (alias: mgr)(id, date, status, amount)
categories(type, date, name, amount)
Task: Retrieve code from managers with value above the AVG(value) of categories rows sharing the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14033 | train |
v3 | Schema:
customers (alias: cust)(date, amount, salary, name)
departments(date, salary, type, code)
Task: Find amount from customers where value exceeds the total value from departments for the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14034 | train |
v1 | Schema:
customers (alias: cust)(salary, code, amount, type)
managers(status, amount, code, salary)
Task: Find name from customers where level appears in managers entries with matching id.
SQL: | SELECT name FROM customers AS cust
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14035 | train |
v2 | Schema:
schedules (alias: schd)(id, date, status, type)
items(code, value, date, salary)
Task: Find salary from schedules where a matching record exists in items with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14036 | train |
v3 | Schema:
projects (alias: prj)(status, amount, date, level)
items(status, code, id, salary)
Task: Find salary from projects where value exceeds the total amount from items for the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14037 | train |
v1 | Schema:
branches (alias: brc)(level, status, value, amount)
accounts(status, name, value, code)
Task: Find amount from branches where id appears in accounts entries with matching type.
SQL: | SELECT amount FROM branches AS brc
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14038 | train |
v1 | Schema:
accounts (alias: acct)(salary, code, id, status)
departments(date, salary, value, code)
Task: Select name from accounts where id exists in departments for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14039 | train |
v1 | Schema:
sales (alias: sale)(status, id, salary, name)
items(code, date, salary, level)
Task: Select id from sales where code exists in items for the same type.
SQL: | SELECT id FROM sales AS sale
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14040 | train |
v1 | Schema:
sales (alias: sale)(status, id, salary, code)
orders(id, salary, status, amount)
Task: Find salary from sales where id appears in orders entries with matching type.
SQL: | SELECT salary FROM sales AS sale
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14041 | train |
v3 | Schema:
staff (alias: empl)(type, id, status, level)
orders(id, value, type, salary)
Task: Retrieve amount from staff with value above the SUM(value) of orders rows sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14042 | train |
v2 | Schema:
sales (alias: sale)(level, value, code, id)
tasks(status, code, date, amount)
Task: Find code from sales where a matching record exists in tasks with the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14043 | train |
v2 | Schema:
employees (alias: emp)(amount, name, salary, id)
invoices(type, id, code, value)
Task: Find code from employees where a matching record exists in invoices with the same type.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14044 | train |
v2 | Schema:
managers (alias: mgr)(date, level, name, amount)
sales(date, salary, level, status)
Task: Retrieve amount from managers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14045 | train |
v3 | Schema:
categories (alias: catg)(amount, date, level, name)
invoices(code, date, value, id)
Task: Find code from categories where amount exceeds the minimum salary from invoices for the same level.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14046 | train |
v1 | Schema:
items (alias: lne)(status, value, name, type)
departments(code, type, date, id)
Task: Select salary from items where id exists in departments for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14047 | train |
v3 | Schema:
customers (alias: cust)(date, name, amount, salary)
regions(status, level, salary, id)
Task: Retrieve name from customers with salary above the AVG(salary) of regions rows sharing the same status.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14048 | train |
v2 | Schema:
schedules (alias: schd)(name, amount, salary, type)
managers(salary, date, type, status)
Task: Find name from schedules where a matching record exists in managers with the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14049 | train |
v3 | Schema:
sales (alias: sale)(value, level, name, code)
regions(amount, level, type, status)
Task: Retrieve value from sales with amount above the SUM(amount) of regions rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14050 | train |
v3 | Schema:
items (alias: lne)(date, salary, type, name)
departments(code, type, status, date)
Task: Find amount from items where salary exceeds the average value from departments for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14051 | train |
v2 | Schema:
employees (alias: emp)(id, type, salary, code)
schedules(salary, id, level, code)
Task: Retrieve salary from employees that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14052 | train |
v3 | Schema:
tasks (alias: tsk)(id, name, date, status)
categories(name, code, value, amount)
Task: Retrieve id from tasks with salary above the MIN(amount) of categories rows sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14053 | train |
v2 | Schema:
accounts (alias: acct)(amount, level, type, code)
items(id, status, code, date)
Task: Find id from accounts where a matching record exists in items with the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14054 | train |
v2 | Schema:
projects (alias: prj)(value, level, code, type)
accounts(amount, code, name, level)
Task: Retrieve code from projects that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14055 | train |
v3 | Schema:
shipments (alias: shp)(date, name, id, level)
projects(salary, status, amount, code)
Task: Find name from shipments where amount exceeds the average amount from projects for the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14056 | train |
v1 | Schema:
invoices (alias: inv)(id, salary, value, date)
departments(value, type, status, name)
Task: Find name from invoices where code appears in departments entries with matching level.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14057 | train |
v2 | Schema:
regions (alias: rgn)(salary, type, date, name)
requests(type, amount, date, id)
Task: Retrieve amount from regions that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14058 | train |
v1 | Schema:
invoices (alias: inv)(id, type, salary, status)
staff(type, code, salary, date)
Task: Find id from invoices where code appears in staff entries with matching status.
SQL: | SELECT id FROM invoices AS inv
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14059 | train |
v3 | Schema:
tasks (alias: tsk)(value, salary, date, code)
invoices(date, type, level, code)
Task: Find salary from tasks where value exceeds the minimum amount from invoices for the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14060 | train |
v2 | Schema:
regions (alias: rgn)(salary, level, type, name)
staff(amount, name, status, salary)
Task: Find salary from regions where a matching record exists in staff with the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14061 | train |
v2 | Schema:
orders (alias: ord)(type, value, salary, code)
transactions(salary, amount, date, code)
Task: Find value from orders where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14062 | train |
v1 | Schema:
staff (alias: empl)(name, id, level, date)
orders(status, amount, id, type)
Task: Retrieve code from staff whose type is found in orders rows where status matches the outer record.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14063 | train |
v1 | Schema:
sales (alias: sale)(name, amount, code, value)
invoices(amount, level, date, status)
Task: Retrieve value from sales whose code is found in invoices rows where code matches the outer record.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14064 | train |
v2 | Schema:
transactions (alias: txn)(status, date, type, value)
orders(date, amount, salary, name)
Task: Retrieve amount from transactions that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14065 | train |
v2 | Schema:
staff (alias: empl)(code, amount, date, name)
employees(id, salary, code, date)
Task: Find id from staff where a matching record exists in employees with the same code.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14066 | train |
v1 | Schema:
categories (alias: catg)(type, level, salary, status)
regions(value, status, code, salary)
Task: Retrieve code from categories whose code is found in regions rows where code matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14067 | train |
v2 | Schema:
projects (alias: prj)(name, value, id, amount)
employees(code, type, amount, date)
Task: Retrieve name from projects that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_14068 | train |
v2 | Schema:
invoices (alias: inv)(code, date, id, value)
managers(type, value, id, status)
Task: Find value from invoices where a matching record exists in managers with the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14069 | train |
v2 | Schema:
tasks (alias: tsk)(amount, code, name, id)
orders(salary, date, name, type)
Task: Find id from tasks where a matching record exists in orders with the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14070 | train |
v3 | Schema:
staff (alias: empl)(date, status, salary, value)
regions(status, code, level, amount)
Task: Retrieve salary from staff with salary above the SUM(salary) of regions rows sharing the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14071 | train |
v3 | Schema:
transactions (alias: txn)(salary, amount, type, date)
tasks(date, amount, level, code)
Task: Retrieve name from transactions with amount above the SUM(amount) of tasks rows sharing the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14072 | train |
v3 | Schema:
invoices (alias: inv)(name, id, level, status)
staff(date, amount, name, value)
Task: Find id from invoices where salary exceeds the total salary from staff for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14073 | train |
v2 | Schema:
sales (alias: sale)(id, salary, type, name)
schedules(salary, code, type, status)
Task: Find value from sales where a matching record exists in schedules with the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14074 | train |
v1 | Schema:
accounts (alias: acct)(level, date, status, value)
sales(name, salary, id, date)
Task: Select id from accounts where status exists in sales for the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14075 | train |
v3 | Schema:
staff (alias: empl)(id, code, salary, value)
products(type, value, code, salary)
Task: Find salary from staff where value exceeds the count of salary from products for the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14076 | train |
v1 | Schema:
items (alias: lne)(status, code, name, date)
customers(salary, code, level, name)
Task: Select salary from items where type exists in customers for the same level.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14077 | train |
v2 | Schema:
categories (alias: catg)(status, amount, salary, date)
schedules(type, code, amount, value)
Task: Retrieve value from categories that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT value 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": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14078 | train |
v2 | Schema:
departments (alias: dept)(value, id, salary, name)
orders(value, amount, type, name)
Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14079 | train |
v2 | Schema:
categories (alias: catg)(type, amount, salary, level)
schedules(date, salary, value, id)
Task: Find amount from categories where a matching record exists in schedules with the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_14080 | train |
v1 | Schema:
accounts (alias: acct)(amount, type, date, salary)
orders(value, amount, id, date)
Task: Find value from accounts where type appears in orders entries with matching type.
SQL: | SELECT value FROM accounts AS acct
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14081 | train |
v2 | Schema:
requests (alias: ordr)(salary, value, name, amount)
staff(value, type, code, name)
Task: Find id from requests where a matching record exists in staff with the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_14082 | train |
v2 | Schema:
regions (alias: rgn)(type, value, level, name)
invoices(code, name, type, salary)
Task: Retrieve amount from regions that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14083 | train |
v2 | Schema:
branches (alias: brc)(name, value, code, salary)
schedules(type, code, salary, status)
Task: Find id from branches where a matching record exists in schedules with the same id.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_14084 | train |
v1 | Schema:
transactions (alias: txn)(date, value, amount, status)
accounts(date, salary, type, id)
Task: Find code from transactions where code appears in accounts entries with matching id.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14085 | train |
v1 | Schema:
customers (alias: cust)(status, type, salary, name)
branches(code, salary, id, level)
Task: Select code from customers where id exists in branches for the same level.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14086 | train |
v1 | Schema:
shipments (alias: shp)(type, date, level, id)
transactions(salary, name, amount, type)
Task: Retrieve value from shipments whose type is found in transactions rows where status matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_14087 | train |
v3 | Schema:
orders (alias: ord)(id, salary, value, level)
categories(name, code, value, date)
Task: Retrieve salary from orders with amount above the SUM(salary) of categories rows sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14088 | train |
v2 | Schema:
departments (alias: dept)(level, code, name, id)
categories(name, amount, type, id)
Task: Retrieve salary from departments that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14089 | train |
v3 | Schema:
tasks (alias: tsk)(code, id, salary, date)
transactions(id, type, status, value)
Task: Retrieve salary from tasks with value above the COUNT(amount) of transactions rows sharing the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_14090 | train |
v2 | Schema:
regions (alias: rgn)(status, level, date, id)
customers(value, type, salary, level)
Task: Find amount from regions where a matching record exists in customers with the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14091 | train |
v1 | Schema:
regions (alias: rgn)(date, value, id, code)
employees(salary, name, level, amount)
Task: Select name from regions where level exists in employees for the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_14092 | train |
v3 | Schema:
managers (alias: mgr)(status, value, level, code)
employees(amount, id, code, value)
Task: Find value from managers where amount exceeds the average amount from employees for the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14093 | train |
v2 | Schema:
items (alias: lne)(status, name, value, id)
invoices(date, status, type, value)
Task: Retrieve id from items that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_14094 | train |
v1 | Schema:
orders (alias: ord)(name, code, amount, value)
products(type, salary, code, id)
Task: Select salary from orders where id exists in products for the same code.
SQL: | SELECT salary 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": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14095 | train |
v2 | Schema:
products (alias: prod)(type, code, date, value)
regions(date, type, value, status)
Task: Retrieve value from products that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14096 | train |
v1 | Schema:
employees (alias: emp)(name, amount, code, date)
departments(salary, level, id, name)
Task: Retrieve value from employees whose id is found in departments rows where id matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14097 | train |
v3 | Schema:
staff (alias: empl)(date, level, id, code)
tasks(date, value, salary, code)
Task: Find name from staff where salary exceeds the average amount from tasks for the same status.
SQL: | SELECT name FROM staff AS empl
WHERE salary > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_14098 | train |
v1 | Schema:
departments (alias: dept)(status, value, name, level)
staff(name, value, date, id)
Task: Retrieve id from departments whose status is found in staff rows where level matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_14099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.