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:
products (alias: prod)(date, type, code, amount)
customers(value, type, id, code)
Task: Find id from products where value exceeds the average salary from customers for the same status.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.status = prod.status
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01000 | train |
v1 | Schema:
employees (alias: emp)(type, status, id, level)
requests(name, amount, level, code)
Task: Select value from employees where id exists in requests for the same status.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01001 | train |
v1 | Schema:
customers (alias: cust)(value, date, amount, status)
branches(id, level, code, date)
Task: Retrieve salary from customers whose level is found in branches rows where code matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01002 | train |
v2 | Schema:
schedules (alias: schd)(value, type, status, name)
orders(type, status, amount, salary)
Task: Retrieve id from schedules that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01003 | train |
v3 | Schema:
requests (alias: ordr)(value, type, salary, status)
managers(amount, value, name, id)
Task: Retrieve code from requests with value above the SUM(salary) of managers rows sharing the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01004 | train |
v1 | Schema:
invoices (alias: inv)(date, status, id, code)
branches(value, id, code, level)
Task: Select id from invoices where type exists in branches for the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01005 | train |
v1 | Schema:
items (alias: lne)(level, date, type, status)
requests(id, date, amount, level)
Task: Select code from items where code exists in requests for the same id.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01006 | train |
v1 | Schema:
customers (alias: cust)(salary, level, code, value)
requests(amount, type, date, salary)
Task: Find salary from customers where code appears in requests entries with matching type.
SQL: | SELECT salary FROM customers AS cust
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01007 | train |
v1 | Schema:
requests (alias: ordr)(value, amount, salary, id)
departments(value, name, level, id)
Task: Find id from requests where status appears in departments entries with matching code.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01008 | train |
v1 | Schema:
shipments (alias: shp)(id, name, type, level)
schedules(name, id, salary, type)
Task: Retrieve amount from shipments whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01009 | train |
v1 | Schema:
employees (alias: emp)(code, salary, name, date)
departments(date, salary, amount, status)
Task: Select id from employees where code exists in departments for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01010 | train |
v2 | Schema:
shipments (alias: shp)(status, id, value, salary)
invoices(salary, code, status, name)
Task: Find salary from shipments where a matching record exists in invoices with the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01011 | train |
v3 | Schema:
invoices (alias: inv)(id, status, value, date)
sales(code, salary, id, level)
Task: Find id from invoices where salary exceeds the count of amount from sales for the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01012 | train |
v2 | Schema:
branches (alias: brc)(amount, name, level, code)
managers(status, id, name, level)
Task: Retrieve value from branches that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01013 | train |
v3 | Schema:
employees (alias: emp)(id, level, name, value)
managers(date, name, value, type)
Task: Find value from employees where amount exceeds the maximum salary from managers for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01014 | train |
v3 | Schema:
managers (alias: mgr)(date, type, level, status)
transactions(status, salary, name, type)
Task: Find amount from managers where amount exceeds the maximum salary from transactions for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01015 | train |
v3 | Schema:
items (alias: lne)(amount, name, level, id)
transactions(level, date, id, status)
Task: Retrieve name from items with amount above the SUM(value) of transactions rows sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01016 | train |
v3 | Schema:
tasks (alias: tsk)(type, level, code, value)
products(amount, value, salary, status)
Task: Retrieve id from tasks with salary above the SUM(value) of products rows sharing the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE salary > (
SELECT SUM(value) FROM products AS prod
WHERE prod.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01017 | train |
v2 | Schema:
products (alias: prod)(level, code, value, salary)
transactions(amount, date, value, id)
Task: Retrieve name from products that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01018 | train |
v3 | Schema:
customers (alias: cust)(id, level, name, date)
regions(type, code, status, value)
Task: Find salary from customers where salary exceeds the minimum amount from regions for the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01019 | train |
v1 | Schema:
employees (alias: emp)(value, date, code, status)
departments(date, code, id, type)
Task: Retrieve name from employees whose id is found in departments rows where status matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01020 | train |
v3 | Schema:
sales (alias: sale)(level, type, code, name)
projects(level, status, amount, salary)
Task: Find salary from sales where salary exceeds the average salary from projects for the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01021 | train |
v1 | Schema:
products (alias: prod)(amount, id, value, status)
requests(level, value, amount, date)
Task: Select code from products where level exists in requests for the same type.
SQL: | SELECT code FROM products AS prod
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01022 | train |
v3 | Schema:
tasks (alias: tsk)(name, amount, status, type)
managers(amount, code, date, status)
Task: Find amount from tasks where salary exceeds the total value from managers for the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE salary > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01023 | train |
v1 | Schema:
categories (alias: catg)(value, salary, level, date)
projects(type, id, name, salary)
Task: Retrieve code from categories whose level is found in projects rows where type matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01024 | train |
v1 | Schema:
tasks (alias: tsk)(type, id, status, value)
managers(code, name, date, salary)
Task: Find code from tasks where status appears in managers entries with matching type.
SQL: | SELECT code FROM tasks AS tsk
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01025 | train |
v1 | Schema:
managers (alias: mgr)(amount, level, type, salary)
regions(code, level, type, name)
Task: Find name from managers where type appears in regions entries with matching level.
SQL: | SELECT name FROM managers AS mgr
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01026 | train |
v2 | Schema:
regions (alias: rgn)(level, value, id, type)
products(level, salary, amount, date)
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_01027 | train |
v1 | Schema:
products (alias: prod)(type, level, date, amount)
transactions(type, id, amount, level)
Task: Select value from products where code exists in transactions for the same code.
SQL: | SELECT value FROM products AS prod
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = prod.code
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01028 | train |
v1 | Schema:
managers (alias: mgr)(salary, status, value, level)
employees(name, salary, date, value)
Task: Retrieve name from managers whose id is found in employees rows where level matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01029 | train |
v1 | Schema:
employees (alias: emp)(value, status, level, code)
shipments(date, type, level, status)
Task: Select value from employees where level exists in shipments for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01030 | train |
v2 | Schema:
orders (alias: ord)(amount, name, status, level)
transactions(amount, status, level, salary)
Task: Find salary from orders where a matching record exists in transactions with the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01031 | train |
v2 | Schema:
tasks (alias: tsk)(value, level, status, code)
requests(id, code, level, value)
Task: Retrieve amount from tasks that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01032 | train |
v3 | Schema:
branches (alias: brc)(date, salary, name, type)
projects(date, status, code, value)
Task: Retrieve value from branches with salary above the SUM(amount) of projects rows sharing the same id.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01033 | train |
v2 | Schema:
schedules (alias: schd)(amount, level, value, type)
categories(amount, level, salary, value)
Task: Retrieve amount from schedules that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01034 | train |
v2 | Schema:
requests (alias: ordr)(level, status, code, id)
shipments(status, salary, amount, name)
Task: Retrieve amount from requests that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01035 | train |
v3 | Schema:
items (alias: lne)(id, type, salary, value)
regions(name, salary, code, type)
Task: Retrieve code from items with salary above the SUM(amount) of regions rows sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01036 | train |
v1 | Schema:
employees (alias: emp)(status, code, type, id)
schedules(amount, status, code, id)
Task: Retrieve id from employees whose code is found in schedules rows where code matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01037 | train |
v1 | Schema:
regions (alias: rgn)(id, code, level, amount)
managers(code, level, amount, type)
Task: Select value from regions where status exists in managers for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01038 | train |
v1 | Schema:
sales (alias: sale)(code, type, status, level)
invoices(date, status, name, id)
Task: Retrieve name from sales whose code is found in invoices rows where code matches the outer record.
SQL: | SELECT name 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": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01039 | train |
v2 | Schema:
tasks (alias: tsk)(name, salary, id, type)
customers(date, name, amount, value)
Task: Find name from tasks where a matching record exists in customers with the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_01040 | train |
v3 | Schema:
accounts (alias: acct)(date, name, value, salary)
departments(level, amount, code, date)
Task: Retrieve value from accounts with amount above the MIN(salary) of departments rows sharing the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE amount > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01041 | train |
v2 | Schema:
accounts (alias: acct)(status, salary, id, value)
invoices(code, id, status, value)
Task: Retrieve amount from accounts that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01042 | train |
v3 | Schema:
shipments (alias: shp)(amount, type, id, value)
branches(name, code, salary, amount)
Task: Retrieve amount from shipments with salary above the SUM(salary) of branches rows sharing the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01043 | train |
v3 | Schema:
shipments (alias: shp)(type, name, code, level)
departments(id, type, value, name)
Task: Find name from shipments where amount exceeds the count of value from departments for the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01044 | train |
v1 | Schema:
items (alias: lne)(level, name, salary, amount)
staff(type, amount, status, value)
Task: Find salary from items where level appears in staff entries with matching type.
SQL: | SELECT salary FROM items AS lne
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01045 | train |
v2 | Schema:
staff (alias: empl)(date, name, id, value)
categories(level, type, name, value)
Task: Find salary from staff where a matching record exists in categories with the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01046 | train |
v3 | Schema:
branches (alias: brc)(level, salary, code, type)
employees(salary, value, code, date)
Task: Find code from branches where amount exceeds the maximum salary from employees for the same type.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01047 | train |
v3 | Schema:
transactions (alias: txn)(status, id, date, amount)
shipments(type, level, value, id)
Task: Retrieve salary from transactions with salary above the COUNT(value) of shipments rows sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01048 | train |
v1 | Schema:
categories (alias: catg)(value, salary, status, code)
departments(id, status, date, value)
Task: Select name from categories where level exists in departments for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01049 | train |
v2 | Schema:
projects (alias: prj)(level, amount, salary, date)
staff(value, name, code, status)
Task: Retrieve amount from projects that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01050 | train |
v1 | Schema:
items (alias: lne)(name, amount, status, date)
categories(name, value, type, level)
Task: Select amount from items where type exists in categories for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.code = lne.code
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01051 | train |
v2 | Schema:
branches (alias: brc)(name, id, type, status)
managers(code, status, salary, value)
Task: Retrieve amount from branches that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01052 | train |
v1 | Schema:
requests (alias: ordr)(id, name, status, salary)
departments(type, date, salary, code)
Task: Select id from requests where status exists in departments for the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01053 | train |
v2 | Schema:
projects (alias: prj)(code, name, date, amount)
departments(date, amount, type, value)
Task: Retrieve code from projects that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01054 | train |
v3 | Schema:
items (alias: lne)(date, amount, type, salary)
tasks(code, date, status, amount)
Task: Retrieve name from items with amount above the SUM(value) of tasks rows sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01055 | train |
v3 | Schema:
products (alias: prod)(salary, date, type, level)
invoices(code, type, name, level)
Task: Find id from products where amount exceeds the minimum salary from invoices for the same type.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.type = prod.type
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01056 | train |
v3 | Schema:
departments (alias: dept)(date, salary, code, name)
staff(salary, value, status, type)
Task: Find code from departments where salary exceeds the total salary from staff for the same status.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01057 | train |
v2 | Schema:
customers (alias: cust)(date, type, salary, id)
employees(date, level, status, name)
Task: Find value from customers where a matching record exists in employees with the same level.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01058 | train |
v3 | Schema:
items (alias: lne)(status, name, salary, value)
regions(salary, status, value, code)
Task: Find name from items where salary exceeds the total amount from regions for the same level.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01059 | train |
v2 | Schema:
staff (alias: empl)(date, status, value, type)
tasks(name, value, type, level)
Task: Retrieve code from staff that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01060 | train |
v2 | Schema:
products (alias: prod)(status, level, date, value)
shipments(value, status, code, date)
Task: Retrieve code from products that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01061 | train |
v2 | Schema:
branches (alias: brc)(salary, date, code, amount)
categories(name, code, date, salary)
Task: Find amount from branches where a matching record exists in categories with the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01062 | train |
v1 | Schema:
categories (alias: catg)(type, date, amount, name)
branches(type, level, name, code)
Task: Select value from categories where code exists in branches for the same level.
SQL: | SELECT value FROM categories AS catg
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01063 | train |
v2 | Schema:
projects (alias: prj)(status, name, salary, date)
customers(type, amount, level, code)
Task: Retrieve value from projects that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01064 | train |
v1 | Schema:
requests (alias: ordr)(id, amount, value, salary)
transactions(level, name, status, id)
Task: Retrieve amount from requests whose type is found in transactions rows where id matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01065 | train |
v2 | Schema:
regions (alias: rgn)(id, type, date, code)
orders(status, type, salary, value)
Task: Find id from regions where a matching record exists in orders with the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_01066 | train |
v2 | Schema:
transactions (alias: txn)(date, name, id, amount)
managers(id, code, name, type)
Task: Retrieve value from transactions that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01067 | train |
v3 | Schema:
customers (alias: cust)(salary, amount, type, status)
managers(date, status, id, value)
Task: Retrieve id from customers with salary above the SUM(amount) of managers rows sharing the same type.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01068 | train |
v1 | Schema:
departments (alias: dept)(salary, amount, level, value)
managers(level, date, name, value)
Task: Retrieve amount from departments whose code is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01069 | train |
v2 | Schema:
sales (alias: sale)(id, level, amount, salary)
accounts(name, id, date, type)
Task: Retrieve salary from sales that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01070 | train |
v2 | Schema:
customers (alias: cust)(name, salary, level, code)
departments(date, salary, level, name)
Task: Find value from customers where a matching record exists in departments with the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01071 | train |
v2 | Schema:
items (alias: lne)(code, status, date, id)
departments(date, level, name, code)
Task: Find amount from items where a matching record exists in departments with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = lne.code
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_01072 | train |
v1 | Schema:
branches (alias: brc)(code, value, id, amount)
regions(value, status, name, type)
Task: Select code from branches where type exists in regions for the same type.
SQL: | SELECT code FROM branches AS brc
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_01073 | train |
v1 | Schema:
schedules (alias: schd)(type, date, name, amount)
requests(id, status, code, value)
Task: Retrieve id from schedules whose level is found in requests rows where id matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01074 | train |
v3 | Schema:
products (alias: prod)(name, id, amount, value)
regions(code, amount, salary, status)
Task: Find name from products where amount exceeds the count of amount from regions for the same id.
SQL: | SELECT name FROM products AS prod
WHERE amount > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01075 | train |
v3 | Schema:
shipments (alias: shp)(value, type, amount, level)
employees(id, date, amount, name)
Task: Find id from shipments where value exceeds the minimum amount from employees for the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01076 | train |
v1 | Schema:
customers (alias: cust)(date, name, id, amount)
accounts(amount, level, status, name)
Task: Select code from customers where type exists in accounts for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01077 | train |
v1 | Schema:
transactions (alias: txn)(salary, level, date, amount)
invoices(date, salary, amount, type)
Task: Select value from transactions where id exists in invoices for the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01078 | train |
v3 | Schema:
departments (alias: dept)(value, date, id, amount)
accounts(status, date, type, salary)
Task: Retrieve id from departments with amount above the COUNT(salary) of accounts rows sharing the same level.
SQL: | SELECT id FROM departments AS dept
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01079 | train |
v3 | Schema:
requests (alias: ordr)(status, value, date, level)
branches(value, level, salary, code)
Task: Find amount from requests where amount exceeds the total salary from branches for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01080 | train |
v1 | Schema:
departments (alias: dept)(id, type, code, salary)
invoices(code, id, date, salary)
Task: Retrieve id from departments whose type is found in invoices rows where status matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01081 | train |
v1 | Schema:
orders (alias: ord)(value, status, amount, id)
accounts(amount, level, code, type)
Task: Select salary from orders where id exists in accounts for the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01082 | train |
v3 | Schema:
requests (alias: ordr)(date, code, status, value)
transactions(type, date, status, code)
Task: Find value from requests where value exceeds the maximum salary from transactions for the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_01083 | train |
v3 | Schema:
projects (alias: prj)(name, value, type, id)
products(level, date, salary, type)
Task: Retrieve salary from projects with amount above the MIN(value) of products rows sharing the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT MIN(value) FROM products AS prod
WHERE prod.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01084 | train |
v3 | Schema:
staff (alias: empl)(level, type, date, status)
branches(type, value, amount, id)
Task: Retrieve value from staff with value above the MIN(amount) of branches rows sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01085 | train |
v2 | Schema:
transactions (alias: txn)(value, salary, code, date)
invoices(amount, level, salary, value)
Task: Retrieve id from transactions that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT id 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": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01086 | train |
v1 | Schema:
accounts (alias: acct)(date, status, name, value)
tasks(date, type, code, amount)
Task: Retrieve code from accounts whose type is found in tasks rows where type matches the outer record.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01087 | train |
v2 | Schema:
employees (alias: emp)(amount, name, value, level)
transactions(salary, id, amount, status)
Task: Find value from employees where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01088 | train |
v2 | Schema:
schedules (alias: schd)(level, salary, code, status)
departments(level, amount, id, code)
Task: Find amount from schedules where a matching record exists in departments with the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01089 | train |
v3 | Schema:
projects (alias: prj)(type, salary, code, value)
items(type, date, value, name)
Task: Retrieve salary from projects with value above the SUM(value) of items rows sharing the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE value > (
SELECT SUM(value) FROM items AS lne
WHERE lne.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01090 | train |
v1 | Schema:
categories (alias: catg)(name, id, type, code)
invoices(level, type, id, salary)
Task: Find id from categories where id appears in invoices entries with matching id.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01091 | train |
v3 | Schema:
staff (alias: empl)(id, date, value, code)
accounts(type, name, amount, date)
Task: Find id from staff where value exceeds the total value from accounts for the same type.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_01092 | train |
v2 | Schema:
categories (alias: catg)(name, code, type, status)
customers(name, value, date, amount)
Task: Find amount from categories where a matching record exists in customers with the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_01093 | train |
v2 | Schema:
accounts (alias: acct)(id, status, level, date)
orders(level, code, status, salary)
Task: Find amount from accounts where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01094 | train |
v3 | Schema:
shipments (alias: shp)(code, type, salary, date)
transactions(code, salary, value, name)
Task: Retrieve amount from shipments with salary above the MAX(salary) of transactions rows sharing the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01095 | train |
v2 | Schema:
products (alias: prod)(code, status, level, date)
transactions(salary, id, value, level)
Task: Find id from products where a matching record exists in transactions with the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = prod.code
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01096 | train |
v3 | Schema:
employees (alias: emp)(salary, amount, status, type)
products(date, amount, level, code)
Task: Retrieve code from employees with amount above the COUNT(salary) of products rows sharing the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_01097 | train |
v2 | Schema:
projects (alias: prj)(name, status, date, value)
requests(date, type, value, salary)
Task: Retrieve code from projects that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_01098 | train |
v2 | Schema:
shipments (alias: shp)(status, amount, id, value)
departments(amount, status, id, value)
Task: Retrieve id from shipments that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_01099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.