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:
regions (alias: rgn)(type, code, name, value)
departments(value, amount, status, date)
Task: Find salary from regions where salary exceeds the maximum amount from departments for the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05700 | train |
v1 | Schema:
staff (alias: empl)(salary, amount, status, type)
managers(id, date, type, level)
Task: Select value from staff where level exists in managers for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05701 | train |
v2 | Schema:
branches (alias: brc)(value, status, code, amount)
staff(id, status, date, value)
Task: Find salary from branches where a matching record exists in staff with the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05702 | train |
v2 | Schema:
managers (alias: mgr)(value, salary, status, name)
shipments(salary, name, level, amount)
Task: Retrieve name from managers that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05703 | train |
v2 | Schema:
projects (alias: prj)(level, salary, status, amount)
requests(salary, name, amount, id)
Task: Find id from projects where a matching record exists in requests with the same code.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05704 | train |
v2 | Schema:
shipments (alias: shp)(date, salary, amount, level)
managers(type, name, salary, code)
Task: Find id from shipments where a matching record exists in managers with the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05705 | train |
v3 | Schema:
tasks (alias: tsk)(id, value, type, level)
orders(status, id, level, date)
Task: Find salary from tasks where salary exceeds the average salary from orders for the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE salary > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05706 | train |
v3 | Schema:
tasks (alias: tsk)(date, name, amount, level)
staff(id, name, level, status)
Task: Retrieve id from tasks with salary above the SUM(salary) of staff rows sharing the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE salary > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05707 | train |
v1 | Schema:
tasks (alias: tsk)(status, name, amount, level)
branches(date, level, amount, status)
Task: Retrieve amount from tasks whose type is found in branches rows where type matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05708 | train |
v3 | Schema:
orders (alias: ord)(salary, code, status, value)
departments(amount, level, name, type)
Task: Find name from orders where value exceeds the average value from departments for the same level.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05709 | train |
v3 | Schema:
items (alias: lne)(date, code, id, type)
tasks(amount, type, id, status)
Task: Retrieve id from items with value above the AVG(amount) of tasks rows sharing the same type.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.type = lne.type
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05710 | train |
v3 | Schema:
products (alias: prod)(value, amount, code, date)
transactions(id, level, amount, type)
Task: Retrieve code from products with salary above the COUNT(amount) of transactions rows sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05711 | train |
v1 | Schema:
staff (alias: empl)(name, code, date, id)
customers(level, name, status, amount)
Task: Find name from staff where level appears in customers entries with matching code.
SQL: | SELECT name FROM staff AS empl
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05712 | train |
v3 | Schema:
orders (alias: ord)(level, value, name, code)
requests(amount, name, status, salary)
Task: Find amount from orders where salary exceeds the minimum amount from requests for the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05713 | train |
v2 | Schema:
invoices (alias: inv)(salary, status, level, value)
staff(code, date, status, type)
Task: Retrieve amount from invoices that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05714 | train |
v2 | Schema:
regions (alias: rgn)(level, value, id, type)
shipments(type, amount, code, salary)
Task: Find name from regions where a matching record exists in shipments with the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05715 | train |
v3 | Schema:
staff (alias: empl)(amount, code, status, date)
accounts(status, name, code, amount)
Task: Retrieve name from staff with amount above the SUM(salary) of accounts rows sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05716 | train |
v1 | Schema:
categories (alias: catg)(code, salary, name, value)
projects(amount, code, id, name)
Task: Select amount from categories where type exists in projects for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05717 | train |
v2 | Schema:
staff (alias: empl)(code, value, amount, type)
departments(date, code, name, status)
Task: Retrieve salary from staff that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05718 | train |
v2 | Schema:
requests (alias: ordr)(code, level, amount, value)
transactions(value, date, level, code)
Task: Find value from requests where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05719 | train |
v2 | Schema:
managers (alias: mgr)(type, salary, code, name)
transactions(id, type, level, date)
Task: Find value from managers where a matching record exists in transactions with the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05720 | train |
v1 | Schema:
shipments (alias: shp)(level, date, status, id)
projects(code, type, value, date)
Task: Find id from shipments where level appears in projects entries with matching type.
SQL: | SELECT id FROM shipments AS shp
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05721 | train |
v2 | Schema:
items (alias: lne)(level, type, date, amount)
products(name, code, salary, level)
Task: Find name from items where a matching record exists in products with the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05722 | train |
v2 | Schema:
regions (alias: rgn)(code, level, id, name)
products(level, value, amount, date)
Task: Find amount from regions where a matching record exists in products with the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05723 | train |
v2 | Schema:
schedules (alias: schd)(code, id, name, amount)
orders(id, salary, type, date)
Task: Find amount from schedules where a matching record exists in orders with the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05724 | train |
v1 | Schema:
transactions (alias: txn)(level, value, type, name)
categories(code, value, name, type)
Task: Select amount from transactions where code exists in categories for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05725 | train |
v3 | Schema:
customers (alias: cust)(level, status, code, type)
regions(value, level, id, amount)
Task: Find amount from customers where value exceeds the count of salary from regions for the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05726 | train |
v2 | Schema:
departments (alias: dept)(id, level, amount, status)
regions(status, type, level, id)
Task: Retrieve id from departments that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05727 | train |
v1 | Schema:
departments (alias: dept)(status, level, salary, value)
accounts(value, amount, id, type)
Task: Select salary from departments where type exists in accounts for the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05728 | train |
v1 | Schema:
regions (alias: rgn)(value, id, code, amount)
departments(type, status, value, level)
Task: Find name from regions where code appears in departments entries with matching id.
SQL: | SELECT name FROM regions AS rgn
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05729 | train |
v1 | Schema:
departments (alias: dept)(amount, type, level, name)
tasks(id, level, date, salary)
Task: Retrieve value from departments whose code is found in tasks rows where type matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05730 | train |
v3 | Schema:
employees (alias: emp)(id, amount, level, salary)
accounts(code, date, type, amount)
Task: Find id from employees where value exceeds the minimum salary from accounts for the same level.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05731 | train |
v3 | Schema:
orders (alias: ord)(level, salary, status, value)
sales(code, value, salary, name)
Task: Find amount from orders where salary exceeds the minimum salary from sales for the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05732 | train |
v3 | Schema:
managers (alias: mgr)(salary, value, type, status)
employees(name, salary, id, amount)
Task: Retrieve amount from managers with value above the COUNT(salary) of employees rows sharing the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05733 | train |
v3 | Schema:
invoices (alias: inv)(status, name, amount, id)
products(type, id, salary, name)
Task: Find id from invoices where salary exceeds the average salary from products for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT AVG(salary) FROM products AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05734 | train |
v3 | Schema:
regions (alias: rgn)(date, status, code, id)
categories(code, name, value, salary)
Task: Find name from regions where salary exceeds the count of amount from categories for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05735 | train |
v2 | Schema:
schedules (alias: schd)(value, type, code, date)
accounts(date, name, status, salary)
Task: Retrieve name from schedules that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05736 | train |
v3 | Schema:
employees (alias: emp)(value, level, type, amount)
items(level, date, amount, code)
Task: Retrieve code from employees with value above the SUM(amount) of items rows sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05737 | train |
v3 | Schema:
sales (alias: sale)(value, type, name, id)
categories(level, type, code, date)
Task: Retrieve code from sales with value above the COUNT(amount) of categories rows sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05738 | train |
v2 | Schema:
staff (alias: empl)(salary, id, status, code)
requests(name, code, value, amount)
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_05739 | train |
v3 | Schema:
branches (alias: brc)(id, type, name, amount)
regions(type, amount, date, level)
Task: Find code from branches where salary exceeds the minimum value from regions for the same level.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05740 | train |
v1 | Schema:
orders (alias: ord)(amount, code, status, level)
categories(status, amount, name, level)
Task: Select salary from orders where code exists in categories for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05741 | train |
v3 | Schema:
regions (alias: rgn)(code, amount, value, name)
requests(code, salary, date, status)
Task: Retrieve amount from regions with amount above the SUM(amount) of requests rows sharing the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM requests AS ordr
WHERE ordr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05742 | train |
v3 | Schema:
transactions (alias: txn)(amount, salary, type, code)
products(type, status, level, code)
Task: Find amount from transactions where amount exceeds the average value from products for the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT AVG(value) FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05743 | train |
v1 | Schema:
items (alias: lne)(level, amount, value, code)
shipments(type, salary, id, level)
Task: Select salary from items where type exists in shipments for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05744 | train |
v1 | Schema:
transactions (alias: txn)(salary, level, amount, id)
invoices(level, date, status, code)
Task: Select name from transactions where code exists in invoices for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05745 | train |
v1 | Schema:
customers (alias: cust)(code, id, status, level)
categories(date, type, name, amount)
Task: Select code from customers where level exists in categories for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05746 | train |
v1 | Schema:
employees (alias: emp)(name, level, status, salary)
tasks(type, salary, code, status)
Task: Retrieve code from employees whose level is found in tasks rows where id matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05747 | train |
v2 | Schema:
shipments (alias: shp)(salary, value, date, status)
orders(value, status, salary, level)
Task: Find code from shipments where a matching record exists in orders with the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05748 | train |
v2 | Schema:
departments (alias: dept)(status, salary, value, id)
products(code, level, status, name)
Task: Find code from departments where a matching record exists in products with the same status.
SQL: | SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05749 | train |
v3 | Schema:
managers (alias: mgr)(value, code, amount, level)
regions(status, salary, amount, date)
Task: Find amount from managers where amount exceeds the total amount from regions for the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05750 | train |
v2 | Schema:
regions (alias: rgn)(salary, type, id, name)
customers(value, id, date, name)
Task: Retrieve salary from regions that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05751 | train |
v2 | Schema:
transactions (alias: txn)(value, id, date, amount)
accounts(id, salary, date, status)
Task: Retrieve name from transactions that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05752 | train |
v1 | Schema:
customers (alias: cust)(name, salary, level, code)
managers(level, type, salary, amount)
Task: Find code from customers where id appears in managers entries with matching code.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05753 | train |
v1 | Schema:
customers (alias: cust)(status, value, salary, date)
schedules(name, level, value, code)
Task: Retrieve amount from customers whose type is found in schedules rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05754 | train |
v1 | Schema:
tasks (alias: tsk)(date, id, status, amount)
managers(code, type, status, salary)
Task: Retrieve name from tasks whose code is found in managers rows where code matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05755 | train |
v1 | Schema:
products (alias: prod)(amount, level, salary, id)
categories(status, name, salary, value)
Task: Find name from products where status appears in categories entries with matching level.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = prod.level
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05756 | train |
v2 | Schema:
shipments (alias: shp)(id, amount, code, value)
employees(id, name, type, salary)
Task: Retrieve value from shipments that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05757 | train |
v3 | Schema:
invoices (alias: inv)(level, type, id, status)
accounts(salary, status, amount, type)
Task: Retrieve salary from invoices with salary above the SUM(value) of accounts rows sharing the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05758 | train |
v2 | Schema:
employees (alias: emp)(code, salary, type, amount)
departments(id, type, value, code)
Task: Find amount from employees where a matching record exists in departments with the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05759 | train |
v3 | Schema:
managers (alias: mgr)(name, status, amount, type)
tasks(id, value, date, level)
Task: Retrieve code from managers with value above the MIN(salary) of tasks rows sharing the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05760 | train |
v2 | Schema:
accounts (alias: acct)(type, id, status, code)
invoices(value, type, level, amount)
Task: Retrieve amount from accounts that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05761 | train |
v3 | Schema:
requests (alias: ordr)(type, status, level, name)
items(date, code, amount, level)
Task: Retrieve code from requests with salary above the MIN(value) of items rows sharing the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05762 | train |
v2 | Schema:
requests (alias: ordr)(code, name, amount, id)
categories(status, date, name, level)
Task: Retrieve salary from requests that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05763 | train |
v2 | Schema:
schedules (alias: schd)(status, amount, type, date)
items(id, amount, status, code)
Task: Find name from schedules where a matching record exists in items with the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05764 | train |
v1 | Schema:
orders (alias: ord)(amount, code, type, value)
departments(date, type, amount, name)
Task: Find name from orders where id appears in departments entries with matching level.
SQL: | SELECT name FROM orders AS ord
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05765 | train |
v2 | Schema:
transactions (alias: txn)(value, type, code, status)
regions(level, salary, type, id)
Task: Find value from transactions where a matching record exists in regions with the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05766 | train |
v3 | Schema:
customers (alias: cust)(name, amount, date, salary)
orders(date, status, value, level)
Task: Retrieve value from customers with salary above the COUNT(amount) of orders rows sharing the same type.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05767 | train |
v3 | Schema:
products (alias: prod)(type, code, id, status)
managers(date, id, value, status)
Task: Find id from products where value exceeds the average salary from managers for the same code.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05768 | train |
v1 | Schema:
shipments (alias: shp)(salary, status, code, date)
regions(salary, name, level, amount)
Task: Retrieve salary from shipments whose level is found in regions rows where status matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05769 | train |
v2 | Schema:
projects (alias: prj)(id, salary, value, level)
shipments(type, date, name, amount)
Task: Find name from projects where a matching record exists in shipments with the same code.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05770 | train |
v3 | Schema:
items (alias: lne)(value, id, salary, level)
regions(salary, value, name, id)
Task: Find id from items where salary exceeds the average salary from regions for the same id.
SQL: | SELECT id FROM items AS lne
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05771 | train |
v1 | Schema:
schedules (alias: schd)(date, salary, amount, status)
items(code, name, level, value)
Task: Find name from schedules where code appears in items entries with matching type.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05772 | train |
v1 | Schema:
schedules (alias: schd)(date, type, status, code)
staff(id, salary, amount, name)
Task: Select amount from schedules where type exists in staff for the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05773 | train |
v3 | Schema:
products (alias: prod)(type, name, code, date)
accounts(date, type, name, salary)
Task: Retrieve salary from products with salary above the MAX(salary) of accounts rows sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05774 | train |
v3 | Schema:
managers (alias: mgr)(salary, name, level, id)
shipments(amount, code, type, level)
Task: Find code from managers where value exceeds the average value from shipments for the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05775 | train |
v1 | Schema:
invoices (alias: inv)(amount, salary, value, id)
tasks(salary, date, type, value)
Task: Retrieve salary from invoices whose type is found in tasks rows where level matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05776 | train |
v3 | Schema:
accounts (alias: acct)(date, amount, status, salary)
products(salary, name, value, level)
Task: Find salary from accounts where amount exceeds the minimum salary from products for the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "salary",
"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_05777 | train |
v1 | Schema:
tasks (alias: tsk)(name, salary, value, type)
invoices(id, level, value, type)
Task: Select name from tasks where status exists in invoices for the same code.
SQL: | SELECT name FROM tasks AS tsk
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05778 | train |
v3 | Schema:
accounts (alias: acct)(id, amount, salary, value)
transactions(salary, level, amount, type)
Task: Find amount from accounts where salary exceeds the maximum salary from transactions for the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05779 | train |
v1 | Schema:
customers (alias: cust)(name, level, code, date)
orders(amount, id, type, name)
Task: Retrieve code from customers whose code is found in orders rows where status matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05780 | train |
v2 | Schema:
transactions (alias: txn)(id, level, date, code)
departments(value, salary, date, amount)
Task: Find id from transactions where a matching record exists in departments with the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05781 | train |
v2 | Schema:
tasks (alias: tsk)(salary, date, id, name)
accounts(id, code, date, name)
Task: Retrieve name from tasks that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05782 | train |
v2 | Schema:
categories (alias: catg)(name, date, type, code)
customers(amount, code, level, type)
Task: Find name from categories where a matching record exists in customers with the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05783 | train |
v2 | Schema:
departments (alias: dept)(name, id, level, value)
projects(type, value, salary, level)
Task: Retrieve amount from departments that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05784 | train |
v2 | Schema:
regions (alias: rgn)(name, amount, code, id)
departments(amount, name, type, code)
Task: Retrieve code from regions that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05785 | train |
v2 | Schema:
accounts (alias: acct)(value, salary, id, date)
shipments(code, salary, value, level)
Task: Retrieve amount from accounts that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05786 | train |
v2 | Schema:
customers (alias: cust)(status, code, type, name)
regions(salary, value, id, code)
Task: Find amount from customers where a matching record exists in regions with the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05787 | train |
v3 | Schema:
transactions (alias: txn)(status, id, salary, code)
staff(salary, level, status, name)
Task: Retrieve value from transactions with salary above the MAX(amount) of staff rows sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05788 | train |
v3 | Schema:
products (alias: prod)(name, amount, status, type)
regions(level, type, status, id)
Task: Find salary from products where value exceeds the minimum value from regions for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05789 | train |
v2 | Schema:
orders (alias: ord)(code, amount, salary, level)
accounts(amount, date, id, code)
Task: Retrieve name from orders that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05790 | train |
v1 | Schema:
items (alias: lne)(type, value, id, status)
orders(code, amount, salary, value)
Task: Find id from items where type appears in orders entries with matching level.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05791 | train |
v3 | Schema:
sales (alias: sale)(date, salary, amount, name)
accounts(amount, level, type, id)
Task: Retrieve amount from sales with value above the MAX(salary) of accounts rows sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05792 | train |
v2 | Schema:
categories (alias: catg)(code, value, status, type)
transactions(type, code, status, name)
Task: Find salary from categories where a matching record exists in transactions with the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05793 | train |
v2 | Schema:
transactions (alias: txn)(value, type, name, level)
categories(value, date, id, code)
Task: Retrieve id from transactions that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05794 | train |
v2 | Schema:
shipments (alias: shp)(amount, status, value, name)
categories(date, salary, status, type)
Task: Find id from shipments where a matching record exists in categories with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05795 | train |
v2 | Schema:
managers (alias: mgr)(id, name, date, amount)
departments(id, name, level, type)
Task: Retrieve name from managers that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05796 | train |
v1 | Schema:
regions (alias: rgn)(amount, value, id, type)
invoices(id, date, salary, code)
Task: Select name from regions where id exists in invoices for the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05797 | train |
v2 | Schema:
managers (alias: mgr)(status, code, name, id)
branches(value, level, type, amount)
Task: Find salary from managers where a matching record exists in branches with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05798 | train |
v3 | Schema:
departments (alias: dept)(amount, value, name, id)
tasks(value, level, id, date)
Task: Find value from departments where value exceeds the maximum amount from tasks for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.