variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
requests (alias: ordr)(date, id, level, type)
projects(id, value, code, amount)
Task: Find amount from requests where code appears in projects entries with matching status.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13400 | train |
v3 | Schema:
invoices (alias: inv)(value, name, id, type)
orders(name, salary, type, value)
Task: Find name from invoices where salary exceeds the average amount from orders for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13401 | train |
v3 | Schema:
schedules (alias: schd)(code, date, id, name)
shipments(salary, type, name, level)
Task: Find name from schedules where amount exceeds the minimum salary from shipments for the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13402 | train |
v3 | Schema:
employees (alias: emp)(value, type, code, level)
sales(salary, name, value, amount)
Task: Find salary from employees where value exceeds the average value from sales for the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13403 | train |
v3 | Schema:
requests (alias: ordr)(salary, id, name, amount)
accounts(code, date, status, type)
Task: Find code from requests where amount exceeds the minimum amount from accounts for the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13404 | train |
v1 | Schema:
categories (alias: catg)(level, type, name, status)
customers(level, type, name, amount)
Task: Select name from categories where code exists in customers for the same level.
SQL: | SELECT name FROM categories AS catg
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13405 | train |
v1 | Schema:
orders (alias: ord)(code, salary, level, id)
schedules(amount, code, salary, level)
Task: Select amount from orders where status exists in schedules for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13406 | train |
v1 | Schema:
products (alias: prod)(level, type, date, id)
projects(type, id, amount, value)
Task: Find value from products where level appears in projects entries with matching type.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = prod.type
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13407 | train |
v2 | Schema:
schedules (alias: schd)(value, id, date, name)
accounts(name, date, type, id)
Task: Find name from schedules where a matching record exists in accounts with the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13408 | train |
v2 | Schema:
items (alias: lne)(id, date, value, level)
departments(value, salary, status, type)
Task: Retrieve id from items that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = lne.id
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13409 | train |
v1 | Schema:
projects (alias: prj)(amount, salary, value, date)
shipments(salary, status, id, type)
Task: Retrieve amount from projects whose code is found in shipments rows where type matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13410 | train |
v1 | Schema:
regions (alias: rgn)(date, value, type, name)
invoices(value, date, status, salary)
Task: Select salary from regions where type exists in invoices for the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13411 | train |
v3 | Schema:
categories (alias: catg)(name, level, id, amount)
schedules(type, name, level, status)
Task: Retrieve salary from categories with salary above the MAX(salary) of schedules rows sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13412 | train |
v3 | Schema:
accounts (alias: acct)(amount, id, value, salary)
departments(level, code, status, date)
Task: Find id from accounts where value exceeds the count of salary from departments for the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13413 | train |
v3 | Schema:
tasks (alias: tsk)(status, level, amount, code)
sales(date, status, type, salary)
Task: Retrieve value from tasks with value above the MIN(value) of sales rows sharing the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13414 | train |
v1 | Schema:
schedules (alias: schd)(date, type, salary, id)
employees(code, date, value, status)
Task: Find name from schedules where type appears in employees entries with matching id.
SQL: | SELECT name FROM schedules AS schd
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13415 | train |
v3 | Schema:
categories (alias: catg)(salary, status, code, type)
orders(amount, date, value, status)
Task: Retrieve name from categories with amount above the AVG(salary) of orders rows sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13416 | train |
v1 | Schema:
departments (alias: dept)(amount, status, name, type)
regions(salary, id, code, amount)
Task: Retrieve id from departments whose code is found in regions rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13417 | train |
v1 | Schema:
managers (alias: mgr)(value, name, code, id)
customers(salary, code, name, id)
Task: Select code from managers where id exists in customers for the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13418 | train |
v1 | Schema:
projects (alias: prj)(code, status, date, value)
departments(name, level, value, date)
Task: Select value from projects where type exists in departments for the same code.
SQL: | SELECT value FROM projects AS prj
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13419 | train |
v1 | Schema:
categories (alias: catg)(amount, level, salary, name)
items(value, type, salary, status)
Task: Find amount from categories where level appears in items entries with matching status.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13420 | train |
v1 | Schema:
accounts (alias: acct)(date, status, amount, type)
shipments(id, code, date, level)
Task: Retrieve id from accounts whose status is found in shipments rows where level matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13421 | train |
v2 | Schema:
projects (alias: prj)(status, salary, value, code)
customers(code, salary, id, level)
Task: Retrieve amount from projects that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13422 | train |
v2 | Schema:
staff (alias: empl)(value, date, id, name)
tasks(salary, value, name, id)
Task: Find code from staff where a matching record exists in tasks with the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13423 | train |
v1 | Schema:
schedules (alias: schd)(amount, date, salary, value)
customers(level, name, amount, id)
Task: Find salary from schedules where type appears in customers entries with matching type.
SQL: | SELECT salary FROM schedules AS schd
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13424 | train |
v2 | Schema:
transactions (alias: txn)(status, salary, value, id)
customers(type, id, amount, date)
Task: Find salary from transactions where a matching record exists in customers with the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13425 | train |
v2 | Schema:
managers (alias: mgr)(salary, id, code, value)
transactions(name, status, amount, salary)
Task: Find name from managers where a matching record exists in transactions with the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13426 | train |
v1 | Schema:
staff (alias: empl)(status, amount, date, level)
employees(name, level, date, amount)
Task: Find salary from staff where status appears in employees entries with matching level.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13427 | train |
v2 | Schema:
departments (alias: dept)(code, amount, type, level)
branches(value, type, status, id)
Task: Retrieve salary from departments that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13428 | train |
v2 | Schema:
sales (alias: sale)(code, date, type, id)
regions(amount, value, salary, name)
Task: Retrieve id from sales that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13429 | train |
v1 | Schema:
orders (alias: ord)(value, type, date, amount)
employees(name, type, amount, level)
Task: Find value from orders where level appears in employees entries with matching id.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13430 | train |
v3 | Schema:
items (alias: lne)(date, type, amount, code)
departments(status, date, value, id)
Task: Retrieve code from items with salary above the MIN(value) of departments rows sharing the same id.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.id = lne.id
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13431 | train |
v2 | Schema:
orders (alias: ord)(id, type, status, name)
managers(type, id, status, name)
Task: Retrieve value from orders that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13432 | train |
v3 | Schema:
requests (alias: ordr)(code, type, date, level)
staff(level, salary, code, status)
Task: Retrieve id from requests with amount above the MAX(salary) of staff rows sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13433 | train |
v3 | Schema:
invoices (alias: inv)(status, type, amount, salary)
employees(type, amount, name, value)
Task: Find salary from invoices where salary exceeds the maximum salary from employees for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13434 | train |
v3 | Schema:
items (alias: lne)(value, type, status, salary)
orders(id, code, type, name)
Task: Retrieve value from items with amount above the AVG(value) of orders rows sharing the same id.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13435 | train |
v3 | Schema:
managers (alias: mgr)(value, status, level, date)
sales(salary, name, level, type)
Task: Find value from managers where amount exceeds the average value from sales for the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13436 | train |
v3 | Schema:
branches (alias: brc)(status, code, level, date)
schedules(value, level, id, amount)
Task: Retrieve code from branches with amount above the AVG(value) of schedules rows sharing the same status.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13437 | train |
v3 | Schema:
sales (alias: sale)(value, level, name, id)
shipments(date, id, code, type)
Task: Retrieve salary from sales with amount above the MAX(value) of shipments rows sharing the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13438 | train |
v1 | Schema:
transactions (alias: txn)(id, status, type, salary)
items(amount, type, salary, id)
Task: Retrieve name from transactions whose status is found in items rows where type matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13439 | train |
v3 | Schema:
sales (alias: sale)(level, date, amount, type)
accounts(value, code, amount, level)
Task: Retrieve code from sales with amount above the MAX(salary) of accounts rows sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13440 | train |
v1 | Schema:
managers (alias: mgr)(name, level, amount, type)
shipments(code, value, amount, name)
Task: Select id from managers where status exists in shipments for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13441 | train |
v3 | Schema:
categories (alias: catg)(value, status, name, id)
orders(code, value, salary, amount)
Task: Retrieve id from categories with amount above the MAX(amount) of orders rows sharing the same type.
SQL: | SELECT id FROM categories AS catg
WHERE amount > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13442 | train |
v1 | Schema:
categories (alias: catg)(date, name, value, level)
accounts(name, date, code, id)
Task: Select salary from categories where level exists in accounts for the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13443 | train |
v2 | Schema:
requests (alias: ordr)(id, status, code, date)
customers(date, level, type, value)
Task: Find amount from requests where a matching record exists in customers with the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13444 | train |
v1 | Schema:
customers (alias: cust)(amount, type, salary, status)
branches(level, salary, value, name)
Task: Find id from customers where type appears in branches entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13445 | train |
v2 | Schema:
customers (alias: cust)(date, status, amount, level)
transactions(amount, status, id, date)
Task: Find id from customers where a matching record exists in transactions with the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13446 | train |
v3 | Schema:
regions (alias: rgn)(date, salary, id, name)
transactions(code, level, amount, type)
Task: Retrieve value from regions with value above the SUM(value) of transactions rows sharing the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13447 | train |
v2 | Schema:
staff (alias: empl)(code, type, value, name)
projects(amount, level, name, salary)
Task: Retrieve salary from staff that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13448 | train |
v1 | Schema:
departments (alias: dept)(level, code, id, amount)
categories(amount, id, name, date)
Task: Find value from departments where code appears in categories entries with matching type.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13449 | train |
v2 | Schema:
managers (alias: mgr)(id, level, name, type)
staff(amount, code, salary, type)
Task: Find id from managers where a matching record exists in staff with the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13450 | train |
v1 | Schema:
departments (alias: dept)(date, type, status, amount)
sales(code, id, type, name)
Task: Retrieve value from departments whose type is found in sales rows where status matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13451 | train |
v2 | Schema:
accounts (alias: acct)(name, amount, value, level)
projects(name, salary, type, amount)
Task: Retrieve salary from accounts that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13452 | train |
v1 | Schema:
managers (alias: mgr)(amount, status, id, code)
transactions(code, level, type, value)
Task: Retrieve name from managers whose level is found in transactions rows where id matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13453 | train |
v1 | Schema:
customers (alias: cust)(status, level, date, salary)
products(value, date, type, salary)
Task: Find value from customers where id appears in products entries with matching level.
SQL: | SELECT value FROM customers AS cust
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13454 | train |
v3 | Schema:
products (alias: prod)(code, name, value, type)
requests(name, salary, code, value)
Task: Retrieve code from products with value above the AVG(value) of requests rows sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13455 | train |
v2 | Schema:
tasks (alias: tsk)(value, level, status, type)
schedules(date, type, status, id)
Task: Find name from tasks where a matching record exists in schedules with the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13456 | train |
v1 | Schema:
accounts (alias: acct)(date, id, code, status)
categories(level, date, status, id)
Task: Select id from accounts where code exists in categories for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13457 | train |
v2 | Schema:
orders (alias: ord)(code, name, status, type)
items(id, salary, date, name)
Task: Retrieve name from orders that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13458 | train |
v1 | Schema:
orders (alias: ord)(value, type, id, salary)
sales(amount, name, value, status)
Task: Select salary from orders where id exists in sales for the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13459 | train |
v3 | Schema:
schedules (alias: schd)(value, date, id, type)
products(type, code, id, date)
Task: Find amount from schedules where salary exceeds the minimum value from products for the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13460 | train |
v2 | Schema:
sales (alias: sale)(name, type, salary, status)
tasks(status, salary, code, level)
Task: Retrieve name from sales that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13461 | train |
v3 | Schema:
requests (alias: ordr)(amount, name, id, date)
staff(amount, type, date, value)
Task: Retrieve salary from requests with salary above the MAX(amount) of staff rows sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13462 | train |
v2 | Schema:
orders (alias: ord)(amount, name, id, value)
projects(code, type, id, value)
Task: Find amount from orders where a matching record exists in projects with the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13463 | train |
v2 | Schema:
tasks (alias: tsk)(id, level, salary, status)
categories(type, code, name, date)
Task: Retrieve value from tasks that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13464 | train |
v1 | Schema:
customers (alias: cust)(salary, status, name, value)
categories(code, type, name, level)
Task: Retrieve amount from customers whose code is found in categories rows where level matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13465 | train |
v2 | Schema:
products (alias: prod)(name, code, id, date)
invoices(level, salary, code, status)
Task: Find code from products where a matching record exists in invoices with the same code.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13466 | train |
v3 | Schema:
invoices (alias: inv)(level, type, status, id)
tasks(type, amount, status, name)
Task: Find salary from invoices where salary exceeds the total salary from tasks for the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13467 | train |
v3 | Schema:
sales (alias: sale)(date, value, name, amount)
tasks(level, status, code, name)
Task: Find value from sales where salary exceeds the average value from tasks for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13468 | train |
v2 | Schema:
customers (alias: cust)(id, status, name, value)
regions(type, value, status, salary)
Task: Find id from customers where a matching record exists in regions with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13469 | train |
v2 | Schema:
projects (alias: prj)(amount, value, id, level)
orders(level, amount, status, id)
Task: Find name from projects where a matching record exists in orders with the same type.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13470 | train |
v3 | Schema:
requests (alias: ordr)(status, date, code, type)
projects(level, code, salary, date)
Task: Retrieve code from requests with amount above the MIN(value) of projects rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13471 | train |
v2 | Schema:
shipments (alias: shp)(name, amount, id, salary)
branches(name, date, salary, value)
Task: Find salary from shipments where a matching record exists in branches with the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13472 | train |
v1 | Schema:
employees (alias: emp)(salary, date, name, amount)
products(status, amount, level, code)
Task: Select salary from employees where id exists in products for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13473 | train |
v3 | Schema:
branches (alias: brc)(code, level, salary, value)
employees(date, salary, name, type)
Task: Find amount from branches where amount exceeds the minimum value from employees for the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13474 | train |
v2 | Schema:
products (alias: prod)(name, level, value, code)
shipments(type, value, name, status)
Task: Retrieve value from products that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13475 | train |
v2 | Schema:
categories (alias: catg)(amount, id, level, status)
orders(id, amount, salary, date)
Task: Find code from categories where a matching record exists in orders with the same code.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13476 | train |
v3 | Schema:
accounts (alias: acct)(date, name, amount, type)
invoices(status, date, type, amount)
Task: Retrieve value from accounts with value above the AVG(value) of invoices rows sharing the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT AVG(value) FROM invoices AS inv
WHERE inv.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13477 | train |
v3 | Schema:
branches (alias: brc)(amount, value, date, level)
items(status, code, type, level)
Task: Retrieve name from branches with salary above the MIN(salary) of items rows sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13478 | train |
v1 | Schema:
transactions (alias: txn)(value, amount, date, type)
departments(type, date, status, name)
Task: Select amount from transactions where status exists in departments for the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13479 | train |
v3 | Schema:
departments (alias: dept)(level, type, value, name)
employees(salary, amount, value, id)
Task: Retrieve name from departments with value above the MAX(salary) of employees rows sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13480 | train |
v3 | Schema:
transactions (alias: txn)(type, salary, id, date)
accounts(amount, code, date, name)
Task: Retrieve name from transactions with salary above the MIN(amount) of accounts rows sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13481 | train |
v3 | Schema:
requests (alias: ordr)(level, date, amount, name)
items(name, code, id, date)
Task: Retrieve amount from requests with amount above the MAX(salary) of items rows sharing the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13482 | train |
v3 | Schema:
staff (alias: empl)(id, type, salary, status)
managers(status, name, code, value)
Task: Retrieve amount from staff with amount above the MAX(value) of managers rows sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13483 | train |
v3 | Schema:
customers (alias: cust)(value, name, amount, code)
sales(name, amount, status, salary)
Task: Retrieve code from customers with salary above the AVG(value) of sales rows sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13484 | train |
v3 | Schema:
products (alias: prod)(status, value, date, code)
transactions(value, date, id, code)
Task: Find code from products where amount exceeds the average amount from transactions for the same level.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13485 | train |
v2 | Schema:
accounts (alias: acct)(amount, status, value, id)
managers(code, status, salary, date)
Task: Retrieve id from accounts that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13486 | train |
v3 | Schema:
categories (alias: catg)(code, type, status, date)
invoices(amount, level, name, code)
Task: Find amount from categories where value exceeds the minimum value from invoices for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13487 | train |
v1 | Schema:
sales (alias: sale)(date, status, id, value)
projects(name, date, salary, code)
Task: Find code from sales where type appears in projects entries with matching type.
SQL: | SELECT code FROM sales AS sale
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13488 | train |
v1 | Schema:
accounts (alias: acct)(value, amount, code, level)
requests(level, amount, date, code)
Task: Select code from accounts where code exists in requests for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13489 | train |
v1 | Schema:
departments (alias: dept)(level, amount, id, type)
projects(type, status, id, amount)
Task: Retrieve value from departments whose level is found in projects rows where level matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13490 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, code, level)
tasks(salary, amount, id, status)
Task: Find salary from shipments where a matching record exists in tasks with the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13491 | train |
v3 | Schema:
accounts (alias: acct)(level, id, date, amount)
shipments(level, code, status, id)
Task: Retrieve amount from accounts with salary above the AVG(value) of shipments rows sharing the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13492 | train |
v3 | Schema:
employees (alias: emp)(value, status, salary, amount)
products(status, value, level, amount)
Task: Retrieve amount from employees with amount above the MAX(amount) of products rows sharing the same type.
SQL: | SELECT amount FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13493 | train |
v1 | Schema:
transactions (alias: txn)(id, status, level, name)
products(value, code, level, id)
Task: Retrieve value from transactions whose level is found in products rows where level matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13494 | train |
v3 | Schema:
sales (alias: sale)(code, level, date, name)
branches(status, date, value, name)
Task: Find id from sales where value exceeds the count of salary from branches for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13495 | train |
v3 | Schema:
regions (alias: rgn)(amount, id, status, date)
staff(status, name, code, level)
Task: Retrieve name from regions with value above the AVG(amount) of staff rows sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13496 | train |
v3 | Schema:
managers (alias: mgr)(status, type, id, value)
products(value, code, status, date)
Task: Find code from managers where amount exceeds the count of salary from products for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13497 | train |
v1 | Schema:
staff (alias: empl)(level, amount, value, name)
managers(value, salary, id, code)
Task: Find id from staff where code appears in managers entries with matching code.
SQL: | SELECT id FROM staff AS empl
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13498 | train |
v3 | Schema:
categories (alias: catg)(name, level, salary, code)
requests(value, amount, type, date)
Task: Retrieve value from categories with amount above the COUNT(salary) of requests rows sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13499 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.