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:
employees (alias: emp)(value, id, type, name)
shipments(code, level, id, value)
Task: Find amount from employees where value exceeds the average value from shipments for the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16000 | train |
v3 | Schema:
accounts (alias: acct)(level, value, name, salary)
managers(salary, value, id, status)
Task: Retrieve value from accounts with value above the COUNT(salary) of managers rows sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16001 | train |
v3 | Schema:
customers (alias: cust)(status, salary, type, value)
departments(salary, date, status, code)
Task: Retrieve salary from customers with amount above the SUM(value) of departments rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16002 | train |
v1 | Schema:
customers (alias: cust)(code, salary, name, level)
products(id, code, type, amount)
Task: Select salary from customers where id exists in products for the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16003 | train |
v1 | Schema:
shipments (alias: shp)(amount, type, salary, value)
categories(id, amount, code, date)
Task: Retrieve code from shipments whose code is found in categories rows where code matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16004 | train |
v1 | Schema:
orders (alias: ord)(name, status, amount, type)
accounts(level, salary, id, type)
Task: Retrieve salary from orders whose status is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16005 | train |
v1 | Schema:
regions (alias: rgn)(level, id, code, amount)
staff(code, id, value, amount)
Task: Retrieve amount from regions whose id is found in staff rows where code matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16006 | train |
v2 | Schema:
invoices (alias: inv)(name, code, level, type)
regions(id, date, code, type)
Task: Retrieve id from invoices that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16007 | train |
v1 | Schema:
schedules (alias: schd)(name, salary, code, status)
tasks(amount, value, date, level)
Task: Select code from schedules where id exists in tasks for the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16008 | train |
v2 | Schema:
products (alias: prod)(amount, date, level, name)
accounts(amount, salary, level, code)
Task: Find id from products where a matching record exists in accounts with the same level.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16009 | train |
v2 | Schema:
projects (alias: prj)(date, code, type, level)
transactions(level, value, code, type)
Task: Retrieve id from projects that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16010 | train |
v1 | Schema:
projects (alias: prj)(status, value, salary, name)
requests(status, type, name, level)
Task: Select name from projects where code exists in requests for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16011 | train |
v1 | Schema:
schedules (alias: schd)(date, name, type, salary)
managers(salary, code, name, amount)
Task: Select name from schedules where level exists in managers for the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16012 | train |
v3 | Schema:
employees (alias: emp)(date, value, name, status)
requests(status, type, name, value)
Task: Find code from employees where value exceeds the maximum amount from requests for the same level.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16013 | train |
v1 | Schema:
categories (alias: catg)(name, amount, value, status)
managers(salary, level, amount, type)
Task: Select id from categories where status exists in managers for the same id.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16014 | train |
v3 | Schema:
branches (alias: brc)(salary, amount, id, value)
regions(id, code, amount, salary)
Task: Find code from branches where salary exceeds the total value from regions for the same code.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16015 | train |
v1 | Schema:
regions (alias: rgn)(value, id, level, code)
products(code, value, id, status)
Task: Find code from regions where status appears in products entries with matching id.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16016 | train |
v1 | Schema:
projects (alias: prj)(value, name, type, id)
invoices(status, amount, salary, date)
Task: Retrieve name from projects whose status is found in invoices rows where level matches the outer record.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16017 | train |
v1 | Schema:
shipments (alias: shp)(name, amount, value, date)
branches(date, level, amount, id)
Task: Find name from shipments where type appears in branches entries with matching id.
SQL: | SELECT name FROM shipments AS shp
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16018 | train |
v3 | Schema:
branches (alias: brc)(code, salary, value, level)
transactions(code, id, status, value)
Task: Retrieve code from branches with value above the MAX(amount) of transactions rows sharing the same code.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16019 | train |
v3 | Schema:
items (alias: lne)(type, value, id, date)
branches(amount, salary, date, name)
Task: Find name from items where value exceeds the total salary from branches for the same type.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.type = lne.type
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16020 | train |
v3 | Schema:
shipments (alias: shp)(status, id, salary, name)
tasks(code, type, amount, salary)
Task: Retrieve id from shipments with value above the MAX(salary) of tasks rows sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT MAX(salary) FROM tasks AS tsk
WHERE tsk.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16021 | train |
v2 | Schema:
invoices (alias: inv)(type, date, level, name)
customers(code, salary, status, date)
Task: Find amount from invoices where a matching record exists in customers with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16022 | train |
v1 | Schema:
transactions (alias: txn)(type, status, id, value)
accounts(level, date, status, code)
Task: Select name from transactions where level exists in accounts for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16023 | train |
v2 | Schema:
projects (alias: prj)(amount, level, value, date)
items(status, name, value, type)
Task: Retrieve name from projects that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16024 | train |
v2 | Schema:
categories (alias: catg)(level, name, salary, id)
schedules(code, amount, date, level)
Task: Retrieve code from categories that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16025 | train |
v3 | Schema:
departments (alias: dept)(code, status, date, amount)
tasks(id, date, salary, name)
Task: Retrieve name from departments with amount above the MIN(salary) of tasks rows sharing the same level.
SQL: | SELECT name FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16026 | train |
v1 | Schema:
products (alias: prod)(code, name, level, salary)
staff(type, level, amount, status)
Task: Select name from products where status exists in staff for the same status.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16027 | train |
v3 | Schema:
departments (alias: dept)(code, name, amount, value)
projects(level, type, date, status)
Task: Retrieve salary from departments with salary above the MIN(amount) of projects rows sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT MIN(amount) 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": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16028 | train |
v2 | Schema:
managers (alias: mgr)(salary, level, date, amount)
projects(type, code, status, value)
Task: Retrieve amount from managers that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16029 | train |
v1 | Schema:
schedules (alias: schd)(date, level, code, value)
staff(status, name, level, amount)
Task: Retrieve amount from schedules whose level is found in staff rows where type matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16030 | train |
v2 | Schema:
requests (alias: ordr)(salary, id, status, level)
managers(name, salary, date, id)
Task: Find code from requests where a matching record exists in managers with the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16031 | train |
v1 | Schema:
customers (alias: cust)(type, status, salary, amount)
orders(name, date, salary, id)
Task: Retrieve salary from customers whose status is found in orders rows where level matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16032 | train |
v2 | Schema:
categories (alias: catg)(amount, date, level, id)
projects(code, level, status, name)
Task: Find code from categories where a matching record exists in projects with the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16033 | train |
v1 | Schema:
transactions (alias: txn)(date, type, value, salary)
categories(date, value, amount, id)
Task: Retrieve salary from transactions whose status is found in categories rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16034 | train |
v3 | Schema:
customers (alias: cust)(code, date, level, name)
categories(value, type, name, amount)
Task: Retrieve code from customers with amount above the COUNT(amount) of categories rows sharing the same level.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16035 | train |
v2 | Schema:
products (alias: prod)(amount, level, code, name)
transactions(salary, amount, value, level)
Task: Find name from products where a matching record exists in transactions with the same id.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16036 | train |
v3 | Schema:
departments (alias: dept)(code, value, level, date)
accounts(status, code, date, salary)
Task: Find value from departments where value exceeds the count of value from accounts for the same id.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16037 | train |
v3 | Schema:
departments (alias: dept)(amount, type, level, status)
requests(date, amount, id, type)
Task: Find salary from departments where value exceeds the average value from requests for the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16038 | train |
v3 | Schema:
transactions (alias: txn)(amount, level, name, status)
invoices(type, id, amount, date)
Task: Retrieve code from transactions with amount above the AVG(salary) of invoices rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT AVG(salary) FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16039 | train |
v3 | Schema:
invoices (alias: inv)(type, id, name, level)
schedules(date, level, salary, id)
Task: Retrieve salary from invoices with salary above the MAX(value) of schedules rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16040 | train |
v2 | Schema:
transactions (alias: txn)(date, value, name, salary)
invoices(salary, id, level, value)
Task: Find amount from transactions where a matching record exists in invoices with the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16041 | train |
v3 | Schema:
invoices (alias: inv)(amount, type, salary, level)
accounts(status, value, level, salary)
Task: Retrieve value from invoices with value above the AVG(salary) of accounts rows sharing the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16042 | train |
v3 | Schema:
sales (alias: sale)(name, level, type, value)
accounts(code, type, name, id)
Task: Retrieve name from sales with salary above the SUM(salary) of accounts rows sharing the same status.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16043 | train |
v1 | Schema:
items (alias: lne)(value, id, status, salary)
staff(level, name, id, status)
Task: Select id from items where type exists in staff for the same level.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.level = lne.level
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16044 | train |
v1 | Schema:
items (alias: lne)(type, salary, value, name)
tasks(amount, value, type, status)
Task: Find name from items where code appears in tasks entries with matching type.
SQL: | SELECT name FROM items AS lne
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.type = lne.type
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16045 | train |
v1 | Schema:
transactions (alias: txn)(salary, value, status, level)
projects(type, amount, level, status)
Task: Select amount from transactions where level exists in projects for the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16046 | train |
v2 | Schema:
managers (alias: mgr)(status, code, name, salary)
schedules(type, level, date, status)
Task: Retrieve code from managers that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16047 | train |
v1 | Schema:
requests (alias: ordr)(value, code, date, level)
staff(level, status, value, amount)
Task: Select amount from requests where type exists in staff for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16048 | train |
v1 | Schema:
invoices (alias: inv)(salary, date, name, id)
products(code, date, status, salary)
Task: Retrieve name from invoices whose id is found in products rows where type matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16049 | train |
v3 | Schema:
managers (alias: mgr)(amount, salary, status, code)
tasks(amount, value, status, level)
Task: Find amount from managers where salary exceeds the maximum value from tasks for the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16050 | train |
v2 | Schema:
orders (alias: ord)(code, name, status, value)
departments(value, code, id, amount)
Task: Retrieve name from orders that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16051 | train |
v3 | Schema:
departments (alias: dept)(value, salary, name, amount)
projects(date, name, code, id)
Task: Retrieve id from departments with amount above the MIN(value) of projects rows sharing the same code.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16052 | train |
v2 | Schema:
products (alias: prod)(level, name, status, code)
regions(salary, id, status, level)
Task: Find amount from products where a matching record exists in regions with the same level.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16053 | train |
v2 | Schema:
products (alias: prod)(date, value, id, name)
schedules(amount, status, type, date)
Task: Find id from products where a matching record exists in schedules with the same id.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16054 | train |
v2 | Schema:
regions (alias: rgn)(code, level, amount, date)
customers(code, type, amount, date)
Task: Retrieve amount from regions that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_16055 | train |
v1 | Schema:
projects (alias: prj)(amount, value, date, salary)
requests(code, date, value, type)
Task: Select id from projects where status exists in requests for the same id.
SQL: | SELECT id FROM projects AS prj
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16056 | train |
v3 | Schema:
branches (alias: brc)(id, date, amount, name)
transactions(status, level, type, date)
Task: Retrieve code from branches with salary above the SUM(value) of transactions rows sharing the same status.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16057 | train |
v3 | Schema:
customers (alias: cust)(amount, date, status, type)
invoices(level, date, type, salary)
Task: Retrieve name from customers with amount above the COUNT(amount) of invoices rows sharing the same id.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16058 | train |
v3 | Schema:
items (alias: lne)(name, id, date, type)
managers(code, status, value, amount)
Task: Find amount from items where amount exceeds the total value from managers for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_16059 | train |
v3 | Schema:
categories (alias: catg)(code, date, salary, level)
requests(amount, id, value, salary)
Task: Retrieve value from categories with salary above the MAX(amount) of requests rows sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16060 | train |
v1 | Schema:
schedules (alias: schd)(id, date, salary, status)
regions(id, type, code, value)
Task: Find code from schedules where status appears in regions entries with matching id.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16061 | train |
v2 | Schema:
projects (alias: prj)(type, status, value, salary)
accounts(salary, name, date, value)
Task: Find name from projects where a matching record exists in accounts with the same code.
SQL: | SELECT name 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": "name",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16062 | train |
v2 | Schema:
orders (alias: ord)(type, level, code, name)
projects(value, level, status, date)
Task: Find name from orders where a matching record exists in projects with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16063 | train |
v3 | Schema:
orders (alias: ord)(level, name, code, value)
items(status, id, value, type)
Task: Find name from orders where value exceeds the maximum value from items for the same type.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16064 | train |
v1 | Schema:
orders (alias: ord)(salary, date, value, id)
shipments(amount, value, level, type)
Task: Find name from orders where code appears in shipments entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16065 | train |
v3 | Schema:
shipments (alias: shp)(code, id, salary, amount)
invoices(amount, level, name, salary)
Task: Retrieve code from shipments with value above the MIN(value) of invoices rows sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16066 | train |
v2 | Schema:
requests (alias: ordr)(type, status, name, id)
categories(salary, level, code, name)
Task: Retrieve value from requests that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16067 | train |
v1 | Schema:
branches (alias: brc)(status, code, name, amount)
shipments(level, id, value, type)
Task: Retrieve amount from branches whose type is found in shipments rows where id matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16068 | train |
v2 | Schema:
departments (alias: dept)(id, name, amount, status)
items(code, value, amount, id)
Task: Retrieve amount from departments that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16069 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, status, value)
customers(value, type, amount, salary)
Task: Retrieve salary from schedules whose type is found in customers rows where type matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16070 | train |
v3 | Schema:
sales (alias: sale)(date, value, amount, name)
tasks(value, name, code, type)
Task: Find name from sales where amount exceeds the maximum amount from tasks for the same status.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16071 | train |
v1 | Schema:
tasks (alias: tsk)(value, code, type, date)
branches(date, amount, code, salary)
Task: Select salary from tasks where code exists in branches for the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16072 | train |
v1 | Schema:
invoices (alias: inv)(id, date, level, status)
categories(status, value, id, amount)
Task: Find name from invoices where id appears in categories entries with matching id.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id 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": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16073 | train |
v3 | Schema:
customers (alias: cust)(level, code, amount, status)
regions(name, amount, value, type)
Task: Retrieve salary from customers with value above the SUM(salary) of regions rows sharing the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16074 | train |
v1 | Schema:
shipments (alias: shp)(salary, type, status, id)
customers(salary, date, type, name)
Task: Find value from shipments where level appears in customers entries with matching type.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16075 | train |
v3 | Schema:
tasks (alias: tsk)(id, amount, salary, date)
customers(type, id, value, level)
Task: Find amount from tasks where value exceeds the total value from customers for the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_16076 | train |
v1 | Schema:
transactions (alias: txn)(name, value, code, amount)
invoices(type, name, date, id)
Task: Retrieve salary from transactions whose code is found in invoices rows where code matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16077 | train |
v2 | Schema:
accounts (alias: acct)(status, value, amount, date)
departments(salary, level, value, name)
Task: Retrieve amount from accounts that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16078 | train |
v2 | Schema:
invoices (alias: inv)(salary, amount, date, code)
orders(type, name, salary, code)
Task: Find salary from invoices where a matching record exists in orders with the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16079 | train |
v3 | Schema:
sales (alias: sale)(value, date, salary, status)
managers(amount, salary, id, value)
Task: Retrieve code from sales with value above the AVG(salary) of managers rows sharing the same level.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16080 | train |
v2 | Schema:
invoices (alias: inv)(type, status, amount, date)
regions(status, id, amount, type)
Task: Find salary from invoices where a matching record exists in regions with the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16081 | train |
v2 | Schema:
schedules (alias: schd)(type, date, value, level)
requests(date, code, id, name)
Task: Retrieve value from schedules that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16082 | train |
v2 | Schema:
requests (alias: ordr)(value, code, level, type)
invoices(status, name, salary, code)
Task: Retrieve salary from requests that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_16083 | train |
v3 | Schema:
departments (alias: dept)(amount, name, id, type)
accounts(salary, date, id, code)
Task: Find id from departments where value exceeds the maximum amount from accounts for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16084 | train |
v2 | Schema:
customers (alias: cust)(salary, name, code, level)
staff(id, date, status, code)
Task: Find salary from customers where a matching record exists in staff with the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16085 | train |
v1 | Schema:
staff (alias: empl)(status, level, amount, value)
regions(code, status, type, date)
Task: Select amount from staff where code exists in regions for the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16086 | train |
v3 | Schema:
branches (alias: brc)(code, value, status, id)
shipments(name, salary, value, amount)
Task: Find code from branches where salary exceeds the total salary from shipments for the same status.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_16087 | train |
v1 | Schema:
departments (alias: dept)(type, value, date, status)
staff(id, amount, salary, date)
Task: Select code from departments where code exists in staff for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16088 | train |
v3 | Schema:
accounts (alias: acct)(status, code, type, amount)
sales(value, level, salary, amount)
Task: Find value from accounts where value exceeds the total value from sales for the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16089 | train |
v2 | Schema:
projects (alias: prj)(name, level, date, type)
invoices(value, amount, salary, id)
Task: Find id from projects where a matching record exists in invoices with the same id.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_16090 | train |
v1 | Schema:
staff (alias: empl)(status, id, code, level)
categories(level, amount, name, salary)
Task: Retrieve salary from staff whose status is found in categories rows where level matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16091 | train |
v3 | Schema:
managers (alias: mgr)(value, type, name, status)
sales(value, amount, name, id)
Task: Retrieve name from managers with salary above the SUM(salary) of sales rows sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16092 | train |
v3 | Schema:
staff (alias: empl)(amount, code, name, date)
customers(salary, type, name, date)
Task: Retrieve value from staff with salary above the MAX(value) of customers rows sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_16093 | train |
v3 | Schema:
employees (alias: emp)(value, code, id, type)
branches(salary, level, type, value)
Task: Find code from employees where salary exceeds the minimum amount from branches for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16094 | train |
v2 | Schema:
invoices (alias: inv)(type, date, code, salary)
products(name, level, id, date)
Task: Retrieve code from invoices that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16095 | train |
v3 | Schema:
orders (alias: ord)(code, status, date, salary)
requests(date, id, type, amount)
Task: Find salary from orders where amount exceeds the total value from requests for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_16096 | train |
v2 | Schema:
categories (alias: catg)(level, code, name, type)
shipments(level, amount, type, salary)
Task: Find amount from categories where a matching record exists in shipments with the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16097 | train |
v1 | Schema:
shipments (alias: shp)(id, type, amount, date)
employees(value, name, date, amount)
Task: Find code from shipments where status appears in employees entries with matching status.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_16098 | train |
v2 | Schema:
schedules (alias: schd)(type, level, id, value)
sales(name, type, salary, status)
Task: Find code from schedules where a matching record exists in sales with the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_16099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.