variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
branches (alias: brc)(name, value, type, amount)
transactions(name, status, id, date)
Task: Retrieve salary from branches that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11600 | train |
v1 | Schema:
sales (alias: sale)(code, value, status, id)
departments(value, level, amount, type)
Task: Find value from sales where type appears in departments entries with matching code.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11601 | train |
v3 | Schema:
items (alias: lne)(date, value, status, code)
regions(value, status, date, code)
Task: Retrieve name from items with value above the COUNT(value) of regions rows sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11602 | train |
v2 | Schema:
branches (alias: brc)(status, date, salary, value)
shipments(type, level, amount, value)
Task: Retrieve id from branches that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11603 | train |
v2 | Schema:
customers (alias: cust)(type, code, id, date)
requests(amount, date, type, level)
Task: Retrieve salary from customers that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11604 | train |
v1 | Schema:
staff (alias: empl)(salary, date, id, status)
invoices(salary, type, status, amount)
Task: Find amount from staff where status appears in invoices entries with matching status.
SQL: | SELECT amount FROM staff AS empl
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11605 | train |
v3 | Schema:
regions (alias: rgn)(id, salary, date, value)
managers(value, amount, status, salary)
Task: Retrieve code from regions with value above the COUNT(salary) of managers rows sharing the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11606 | train |
v1 | Schema:
employees (alias: emp)(id, salary, date, type)
accounts(date, value, level, status)
Task: Select name from employees where type exists in accounts for the same status.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11607 | train |
v1 | Schema:
regions (alias: rgn)(level, salary, amount, name)
shipments(type, value, code, name)
Task: Retrieve salary from regions whose code is found in shipments rows where status matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11608 | train |
v3 | Schema:
shipments (alias: shp)(date, level, code, salary)
departments(code, amount, id, level)
Task: Find salary from shipments where value exceeds the average salary from departments for the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11609 | train |
v1 | Schema:
items (alias: lne)(salary, code, level, status)
schedules(value, status, date, id)
Task: Select id from items where id exists in schedules for the same status.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11610 | train |
v2 | Schema:
orders (alias: ord)(status, date, level, value)
categories(salary, code, value, type)
Task: Retrieve amount from orders that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11611 | train |
v3 | Schema:
staff (alias: empl)(date, amount, level, salary)
customers(type, level, status, name)
Task: Retrieve amount from staff with value above the COUNT(amount) of customers rows sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11612 | train |
v2 | Schema:
customers (alias: cust)(date, amount, status, salary)
employees(date, level, type, salary)
Task: Retrieve salary from customers that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11613 | train |
v1 | Schema:
regions (alias: rgn)(salary, type, level, status)
products(value, name, date, type)
Task: Select name from regions where code exists in products for the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11614 | train |
v2 | Schema:
branches (alias: brc)(level, type, salary, value)
shipments(salary, level, status, type)
Task: Retrieve salary from branches that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11615 | train |
v3 | Schema:
shipments (alias: shp)(name, status, date, type)
sales(date, name, amount, code)
Task: Retrieve name from shipments with amount above the MIN(salary) of sales rows sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE amount > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11616 | train |
v3 | Schema:
managers (alias: mgr)(type, level, amount, status)
categories(name, type, id, date)
Task: Retrieve name from managers with value above the MIN(value) of categories rows sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11617 | train |
v1 | Schema:
sales (alias: sale)(code, amount, name, type)
employees(amount, status, date, id)
Task: Find amount from sales where level appears in employees entries with matching type.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11618 | train |
v1 | Schema:
shipments (alias: shp)(amount, status, id, date)
requests(amount, id, salary, code)
Task: Select id from shipments where code exists in requests for the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11619 | train |
v3 | Schema:
projects (alias: prj)(type, value, date, id)
orders(id, salary, type, date)
Task: Retrieve code from projects with amount above the MIN(salary) of orders rows sharing the same id.
SQL: | SELECT code FROM projects AS prj
WHERE amount > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11620 | train |
v1 | Schema:
accounts (alias: acct)(status, id, date, level)
departments(code, status, level, amount)
Task: Find code from accounts where level appears in departments entries with matching status.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11621 | train |
v3 | Schema:
customers (alias: cust)(type, name, code, salary)
employees(id, name, salary, type)
Task: Find name from customers where amount exceeds the minimum salary from employees for the same level.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11622 | train |
v3 | Schema:
departments (alias: dept)(type, amount, code, date)
employees(status, date, name, level)
Task: Retrieve amount from departments with amount above the SUM(salary) of employees rows sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT SUM(salary) FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11623 | train |
v3 | Schema:
items (alias: lne)(status, level, salary, name)
transactions(salary, name, type, status)
Task: Retrieve code from items with amount above the MIN(value) of transactions rows sharing the same code.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.code = lne.code
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11624 | train |
v2 | Schema:
categories (alias: catg)(status, id, date, value)
tasks(status, amount, code, name)
Task: Find code from categories where a matching record exists in tasks with the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11625 | train |
v3 | Schema:
requests (alias: ordr)(value, code, id, status)
employees(level, date, amount, salary)
Task: Retrieve salary from requests with value above the MIN(salary) of employees rows sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11626 | train |
v2 | Schema:
projects (alias: prj)(code, id, type, salary)
branches(type, name, amount, salary)
Task: Retrieve value from projects that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11627 | train |
v2 | Schema:
schedules (alias: schd)(date, status, name, id)
staff(code, amount, date, name)
Task: Retrieve name from schedules that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11628 | train |
v3 | Schema:
employees (alias: emp)(salary, name, id, amount)
departments(salary, name, value, id)
Task: Find name from employees where value exceeds the minimum value from departments for the same id.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11629 | train |
v3 | Schema:
staff (alias: empl)(salary, date, code, level)
schedules(value, salary, code, status)
Task: Retrieve amount from staff with amount above the COUNT(value) of schedules rows sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11630 | train |
v3 | Schema:
sales (alias: sale)(date, salary, code, status)
products(code, value, name, type)
Task: Retrieve id from sales with value above the MIN(value) of products rows sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11631 | train |
v2 | Schema:
managers (alias: mgr)(value, code, id, type)
employees(amount, type, value, date)
Task: Retrieve salary from managers that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11632 | train |
v3 | Schema:
transactions (alias: txn)(salary, id, type, date)
tasks(level, code, name, amount)
Task: Retrieve amount from transactions with salary above the AVG(value) of tasks rows sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11633 | train |
v2 | Schema:
projects (alias: prj)(name, id, date, value)
invoices(amount, date, value, status)
Task: Find salary from projects where a matching record exists in invoices with the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11634 | train |
v2 | Schema:
departments (alias: dept)(code, amount, salary, date)
products(name, salary, value, amount)
Task: Find amount from departments where a matching record exists in products with the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11635 | train |
v1 | Schema:
branches (alias: brc)(value, salary, status, type)
items(name, amount, salary, id)
Task: Retrieve name from branches whose code is found in items rows where code matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11636 | train |
v1 | Schema:
orders (alias: ord)(status, level, id, type)
projects(amount, name, value, date)
Task: Retrieve salary from orders whose level is found in projects rows where code matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11637 | train |
v2 | Schema:
customers (alias: cust)(code, name, type, level)
projects(amount, name, status, value)
Task: Find id from customers where a matching record exists in projects with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11638 | train |
v3 | Schema:
items (alias: lne)(status, date, type, name)
regions(salary, level, value, amount)
Task: Find value from items where salary exceeds the count of value from regions for the same type.
SQL: | SELECT value FROM items AS lne
WHERE salary > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.type = lne.type
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11639 | train |
v2 | Schema:
accounts (alias: acct)(value, status, date, amount)
items(level, id, value, amount)
Task: Find salary from accounts where a matching record exists in items with the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11640 | train |
v2 | Schema:
items (alias: lne)(name, amount, id, type)
categories(amount, code, name, date)
Task: Retrieve name from items that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11641 | train |
v1 | Schema:
tasks (alias: tsk)(salary, amount, status, level)
regions(amount, name, code, id)
Task: Retrieve name from tasks whose type is found in regions rows where type matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11642 | train |
v2 | Schema:
transactions (alias: txn)(value, date, name, type)
staff(salary, type, date, code)
Task: Retrieve salary from transactions that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11643 | train |
v2 | Schema:
invoices (alias: inv)(name, code, status, date)
transactions(amount, type, salary, value)
Task: Retrieve id from invoices that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11644 | train |
v1 | Schema:
staff (alias: empl)(amount, name, code, date)
employees(name, status, amount, id)
Task: Select id from staff where id exists in employees for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11645 | train |
v2 | Schema:
employees (alias: emp)(salary, status, name, date)
departments(status, date, value, type)
Task: Retrieve code from employees that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11646 | train |
v1 | Schema:
sales (alias: sale)(level, value, code, amount)
orders(id, date, type, salary)
Task: Retrieve code from sales whose level is found in orders rows where level matches the outer record.
SQL: | SELECT code FROM sales AS sale
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11647 | train |
v1 | Schema:
managers (alias: mgr)(status, id, amount, name)
staff(salary, date, code, amount)
Task: Retrieve id from managers whose id is found in staff rows where type matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11648 | train |
v3 | Schema:
categories (alias: catg)(type, level, salary, name)
accounts(code, status, date, type)
Task: Find salary from categories where amount exceeds the total salary from accounts for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11649 | train |
v3 | Schema:
schedules (alias: schd)(salary, date, type, id)
staff(value, name, code, type)
Task: Find amount from schedules where value exceeds the count of amount from staff for the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11650 | train |
v3 | Schema:
branches (alias: brc)(salary, level, date, value)
accounts(salary, type, date, id)
Task: Find code from branches where salary exceeds the maximum value from accounts for the same id.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11651 | train |
v2 | Schema:
orders (alias: ord)(level, status, amount, value)
categories(code, date, amount, salary)
Task: Retrieve code from orders that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11652 | train |
v3 | Schema:
transactions (alias: txn)(value, type, code, status)
invoices(id, salary, status, level)
Task: Find value from transactions where amount exceeds the total value from invoices for the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11653 | train |
v1 | Schema:
customers (alias: cust)(code, type, id, amount)
projects(value, salary, level, id)
Task: Find id from customers where code appears in projects entries with matching level.
SQL: | SELECT id FROM customers AS cust
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11654 | train |
v1 | Schema:
projects (alias: prj)(value, level, type, status)
staff(salary, id, date, name)
Task: Select value from projects where code exists in staff for the same type.
SQL: | SELECT value FROM projects AS prj
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11655 | train |
v1 | Schema:
branches (alias: brc)(level, name, status, id)
items(salary, amount, status, id)
Task: Find code from branches where type appears in items entries with matching status.
SQL: | SELECT code FROM branches AS brc
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11656 | train |
v1 | Schema:
requests (alias: ordr)(amount, salary, code, status)
items(value, id, amount, name)
Task: Select value from requests where type exists in items for the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11657 | train |
v3 | Schema:
schedules (alias: schd)(level, id, type, salary)
tasks(salary, name, level, date)
Task: Find salary from schedules where salary exceeds the total salary from tasks for the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11658 | train |
v2 | Schema:
categories (alias: catg)(type, id, amount, code)
accounts(amount, salary, code, level)
Task: Find value from categories where a matching record exists in accounts with the same code.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11659 | train |
v1 | Schema:
tasks (alias: tsk)(value, code, level, name)
orders(amount, date, type, status)
Task: Find value from tasks where status appears in orders entries with matching level.
SQL: | SELECT value FROM tasks AS tsk
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11660 | train |
v3 | Schema:
invoices (alias: inv)(value, type, date, id)
sales(code, type, status, level)
Task: Retrieve value from invoices with value above the AVG(amount) of sales rows sharing the same level.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(amount) FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11661 | train |
v1 | Schema:
employees (alias: emp)(level, value, code, name)
transactions(level, status, id, value)
Task: Select value from employees where type exists in transactions for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11662 | train |
v2 | Schema:
orders (alias: ord)(name, value, date, amount)
schedules(name, code, salary, status)
Task: Retrieve salary from orders that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11663 | train |
v3 | Schema:
orders (alias: ord)(code, type, name, level)
sales(type, salary, amount, name)
Task: Retrieve value from orders with salary above the SUM(value) of sales rows sharing the same code.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11664 | train |
v3 | Schema:
orders (alias: ord)(name, code, status, amount)
customers(level, id, salary, value)
Task: Find id from orders where salary exceeds the count of amount from customers for the same code.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11665 | train |
v2 | Schema:
tasks (alias: tsk)(id, value, name, salary)
accounts(value, name, status, id)
Task: Retrieve id from tasks that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11666 | train |
v2 | Schema:
staff (alias: empl)(type, status, date, amount)
requests(salary, code, type, value)
Task: Find name from staff where a matching record exists in requests with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11667 | train |
v1 | Schema:
orders (alias: ord)(amount, name, status, date)
schedules(salary, value, type, name)
Task: Retrieve code from orders whose id is found in schedules rows where type matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11668 | train |
v3 | Schema:
orders (alias: ord)(value, name, code, salary)
categories(name, date, status, id)
Task: Retrieve id from orders with amount above the AVG(salary) of categories rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11669 | train |
v1 | Schema:
invoices (alias: inv)(salary, date, status, amount)
schedules(date, salary, code, status)
Task: Select id from invoices where level exists in schedules for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11670 | train |
v2 | Schema:
staff (alias: empl)(level, code, value, name)
requests(status, date, amount, type)
Task: Find code from staff where a matching record exists in requests with the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11671 | train |
v1 | Schema:
transactions (alias: txn)(date, type, name, amount)
employees(code, id, salary, status)
Task: Select amount from transactions where code exists in employees for the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11672 | train |
v2 | Schema:
invoices (alias: inv)(date, status, name, id)
customers(status, value, date, id)
Task: Retrieve code from invoices that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11673 | train |
v1 | Schema:
accounts (alias: acct)(status, level, code, salary)
products(type, amount, salary, id)
Task: Retrieve id from accounts whose type is found in products rows where status matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11674 | train |
v3 | Schema:
orders (alias: ord)(status, code, name, amount)
accounts(status, name, type, amount)
Task: Find id from orders where salary exceeds the maximum value from accounts for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11675 | train |
v2 | Schema:
employees (alias: emp)(code, date, amount, name)
categories(value, status, id, code)
Task: Find salary from employees where a matching record exists in categories with the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11676 | train |
v2 | Schema:
tasks (alias: tsk)(id, level, date, code)
categories(name, amount, level, salary)
Task: Retrieve id from tasks that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11677 | train |
v3 | Schema:
orders (alias: ord)(status, level, salary, type)
staff(date, type, code, id)
Task: Retrieve name from orders with amount above the SUM(salary) of staff rows sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11678 | train |
v1 | Schema:
branches (alias: brc)(code, type, name, salary)
projects(value, name, status, id)
Task: Find value from branches where code appears in projects entries with matching code.
SQL: | SELECT value FROM branches AS brc
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11679 | train |
v3 | Schema:
employees (alias: emp)(salary, status, code, name)
items(level, amount, name, salary)
Task: Find id from employees where salary exceeds the total amount from items for the same type.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11680 | train |
v2 | Schema:
requests (alias: ordr)(name, level, date, type)
managers(value, code, level, date)
Task: Retrieve amount from requests that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11681 | train |
v3 | Schema:
transactions (alias: txn)(date, name, amount, code)
products(value, type, code, amount)
Task: Find salary from transactions where salary exceeds the count of salary from products for the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11682 | train |
v3 | Schema:
sales (alias: sale)(id, value, name, level)
requests(code, value, id, type)
Task: Retrieve id from sales with value above the MIN(value) of requests rows sharing the same status.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11683 | train |
v3 | Schema:
items (alias: lne)(level, date, salary, status)
schedules(status, value, type, code)
Task: Find amount from items where amount exceeds the count of amount from schedules for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11684 | train |
v3 | Schema:
tasks (alias: tsk)(name, amount, type, level)
requests(name, salary, type, value)
Task: Retrieve salary from tasks with amount above the SUM(amount) of requests rows sharing the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11685 | train |
v1 | Schema:
invoices (alias: inv)(id, code, name, type)
managers(type, amount, name, salary)
Task: Select amount from invoices where type exists in managers for the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11686 | train |
v2 | Schema:
orders (alias: ord)(type, status, date, value)
tasks(id, amount, value, date)
Task: Retrieve code from orders that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11687 | train |
v2 | Schema:
sales (alias: sale)(name, level, date, code)
items(value, name, date, status)
Task: Find name from sales where a matching record exists in items with the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11688 | train |
v1 | Schema:
products (alias: prod)(level, name, amount, date)
categories(status, type, level, id)
Task: Find value from products where status appears in categories entries with matching status.
SQL: | SELECT value FROM products AS prod
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = prod.status
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11689 | train |
v1 | Schema:
tasks (alias: tsk)(salary, code, name, amount)
orders(level, id, value, code)
Task: Find value from tasks where status appears in orders entries with matching status.
SQL: | SELECT value FROM tasks AS tsk
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11690 | train |
v3 | Schema:
branches (alias: brc)(level, value, date, code)
customers(status, code, id, type)
Task: Find salary from branches where salary exceeds the minimum value from customers for the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11691 | train |
v2 | Schema:
schedules (alias: schd)(status, id, amount, type)
invoices(name, amount, value, date)
Task: Retrieve salary from schedules that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11692 | train |
v3 | Schema:
transactions (alias: txn)(salary, status, id, name)
branches(value, level, date, amount)
Task: Retrieve salary from transactions with value above the AVG(amount) of branches rows sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11693 | train |
v3 | Schema:
orders (alias: ord)(status, level, id, amount)
departments(date, status, code, value)
Task: Find code from orders where salary exceeds the maximum amount from departments for the same type.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11694 | train |
v1 | Schema:
products (alias: prod)(date, amount, id, status)
items(type, id, level, name)
Task: Find amount from products where status appears in items entries with matching level.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = prod.level
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11695 | train |
v1 | Schema:
customers (alias: cust)(id, salary, name, date)
invoices(level, code, name, amount)
Task: Select amount from customers where id exists in invoices for the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11696 | train |
v1 | Schema:
departments (alias: dept)(status, date, code, salary)
items(value, amount, level, type)
Task: Find code from departments where level appears in items entries with matching code.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11697 | train |
v1 | Schema:
requests (alias: ordr)(level, amount, status, value)
tasks(amount, code, type, level)
Task: Retrieve amount from requests whose type is found in tasks rows where code matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11698 | train |
v3 | Schema:
sales (alias: sale)(amount, salary, date, name)
transactions(date, status, name, id)
Task: Find code from sales where salary exceeds the minimum amount from transactions for the same type.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.