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:
customers (alias: cust)(id, name, status, value)
transactions(code, name, id, date)
Task: Retrieve code from customers whose level is found in transactions rows where code matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02700 | train |
v3 | Schema:
regions (alias: rgn)(value, salary, amount, type)
transactions(amount, code, level, type)
Task: Find amount from regions where salary exceeds the count of amount from transactions for the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"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_02701 | train |
v2 | Schema:
employees (alias: emp)(id, type, status, date)
categories(name, amount, level, value)
Task: Retrieve id from employees that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02702 | train |
v2 | Schema:
products (alias: prod)(code, date, name, level)
sales(level, date, salary, id)
Task: Find salary from products where a matching record exists in sales with the same type.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = prod.type
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02703 | train |
v3 | Schema:
staff (alias: empl)(id, type, name, status)
branches(salary, status, date, level)
Task: Retrieve id from staff with salary above the MAX(value) of branches rows sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02704 | train |
v1 | Schema:
items (alias: lne)(status, level, code, type)
staff(salary, code, status, name)
Task: Select salary from items where status exists in staff for the same level.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = lne.level
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02705 | train |
v1 | Schema:
staff (alias: empl)(status, code, type, id)
transactions(date, salary, code, value)
Task: Retrieve salary from staff whose code is found in transactions rows where code matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02706 | train |
v3 | Schema:
items (alias: lne)(amount, name, salary, status)
staff(date, id, salary, status)
Task: Retrieve salary from items with amount above the AVG(value) of staff rows sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02707 | train |
v3 | Schema:
items (alias: lne)(code, status, id, date)
managers(level, code, status, date)
Task: Find amount from items where amount exceeds the count of value from managers for the same id.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02708 | train |
v1 | Schema:
accounts (alias: acct)(status, salary, code, value)
projects(code, type, value, level)
Task: Retrieve value from accounts whose status is found in projects rows where code matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02709 | train |
v2 | Schema:
orders (alias: ord)(code, date, id, salary)
accounts(id, code, value, amount)
Task: Find salary from orders where a matching record exists in accounts with the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02710 | train |
v2 | Schema:
items (alias: lne)(name, value, code, level)
accounts(status, salary, code, amount)
Task: Find value from items where a matching record exists in accounts with the same level.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = lne.level
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02711 | train |
v2 | Schema:
products (alias: prod)(type, code, id, date)
schedules(salary, date, code, name)
Task: Find amount from products where a matching record exists in schedules with the same id.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02712 | train |
v1 | Schema:
tasks (alias: tsk)(salary, level, date, value)
orders(id, level, amount, name)
Task: Select name from tasks where level exists in orders for the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02713 | train |
v2 | Schema:
products (alias: prod)(salary, status, type, code)
shipments(code, value, date, status)
Task: Find value from products where a matching record exists in shipments with the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02714 | train |
v3 | Schema:
accounts (alias: acct)(salary, date, id, status)
orders(date, level, value, amount)
Task: Retrieve salary from accounts with value above the MAX(value) of orders rows sharing the same type.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02715 | train |
v2 | Schema:
sales (alias: sale)(status, code, date, name)
invoices(id, date, level, salary)
Task: Find name from sales where a matching record exists in invoices with the same code.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02716 | train |
v1 | Schema:
branches (alias: brc)(name, amount, value, code)
managers(amount, salary, level, name)
Task: Select id from branches where level exists in managers for the same code.
SQL: | SELECT id FROM branches AS brc
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02717 | train |
v3 | Schema:
invoices (alias: inv)(value, level, code, id)
requests(name, date, amount, type)
Task: Retrieve code from invoices with amount above the MAX(amount) of requests rows sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02718 | train |
v2 | Schema:
departments (alias: dept)(id, amount, type, level)
managers(date, salary, name, value)
Task: Find name from departments where a matching record exists in managers with the same id.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02719 | train |
v2 | Schema:
customers (alias: cust)(name, salary, level, id)
orders(salary, level, date, value)
Task: Retrieve amount from customers that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02720 | train |
v1 | Schema:
departments (alias: dept)(id, type, status, amount)
managers(amount, date, value, code)
Task: Select amount from departments where code exists in managers for the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02721 | train |
v2 | Schema:
customers (alias: cust)(type, value, id, date)
managers(name, status, id, salary)
Task: Retrieve name from customers that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02722 | train |
v2 | Schema:
branches (alias: brc)(name, code, date, type)
customers(name, date, code, id)
Task: Find salary from branches where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02723 | train |
v3 | Schema:
transactions (alias: txn)(code, id, amount, type)
staff(name, value, amount, salary)
Task: Retrieve name from transactions with salary above the SUM(amount) of staff rows sharing the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02724 | train |
v2 | Schema:
employees (alias: emp)(amount, salary, status, date)
branches(salary, value, name, id)
Task: Retrieve code from employees that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02725 | train |
v2 | Schema:
requests (alias: ordr)(salary, code, amount, level)
projects(name, type, status, code)
Task: Retrieve name from requests that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02726 | train |
v1 | Schema:
items (alias: lne)(id, amount, status, code)
managers(value, name, salary, date)
Task: Retrieve value from items whose type is found in managers rows where level matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02727 | train |
v2 | Schema:
regions (alias: rgn)(value, salary, id, level)
tasks(value, level, amount, status)
Task: Retrieve id from regions that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02728 | train |
v1 | Schema:
categories (alias: catg)(code, type, status, value)
employees(value, date, level, status)
Task: Find salary from categories where type appears in employees entries with matching status.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02729 | train |
v1 | Schema:
shipments (alias: shp)(code, name, level, type)
transactions(type, id, value, code)
Task: Select amount from shipments where type exists in transactions for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02730 | train |
v2 | Schema:
branches (alias: brc)(name, type, date, id)
shipments(amount, level, id, date)
Task: Find id from branches where a matching record exists in shipments with the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02731 | train |
v1 | Schema:
managers (alias: mgr)(code, date, type, status)
projects(code, value, type, date)
Task: Retrieve value from managers whose status is found in projects rows where code matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02732 | train |
v2 | Schema:
regions (alias: rgn)(amount, salary, date, id)
transactions(status, salary, id, level)
Task: Retrieve code from regions that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02733 | train |
v2 | Schema:
accounts (alias: acct)(id, status, value, code)
managers(salary, type, code, amount)
Task: Find id from accounts where a matching record exists in managers with the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02734 | train |
v3 | Schema:
customers (alias: cust)(type, status, code, value)
managers(type, code, status, value)
Task: Retrieve salary from customers with amount above the MIN(amount) of managers rows sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02735 | train |
v2 | Schema:
shipments (alias: shp)(date, status, value, type)
staff(value, id, name, code)
Task: Find salary from shipments where a matching record exists in staff with the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02736 | train |
v3 | Schema:
requests (alias: ordr)(value, status, salary, level)
schedules(salary, level, type, amount)
Task: Find amount from requests where value exceeds the maximum salary from schedules for the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02737 | train |
v2 | Schema:
regions (alias: rgn)(name, date, value, status)
departments(status, level, value, salary)
Task: Retrieve value from regions that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT value 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": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02738 | train |
v1 | Schema:
regions (alias: rgn)(date, salary, code, value)
invoices(value, level, amount, salary)
Task: Retrieve code from regions whose id is found in invoices rows where type matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02739 | train |
v2 | Schema:
managers (alias: mgr)(code, date, id, salary)
categories(type, code, value, date)
Task: Retrieve id from managers that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02740 | train |
v3 | Schema:
shipments (alias: shp)(level, value, name, amount)
items(name, level, amount, id)
Task: Retrieve salary from shipments with amount above the SUM(amount) of items rows sharing the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02741 | train |
v2 | Schema:
products (alias: prod)(value, date, amount, type)
shipments(salary, status, code, type)
Task: Find id from products where a matching record exists in shipments with the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02742 | train |
v2 | Schema:
schedules (alias: schd)(level, code, name, date)
items(date, name, level, code)
Task: Retrieve name from schedules that have at least one corresponding entry in items sharing 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_02743 | train |
v3 | Schema:
customers (alias: cust)(level, date, id, code)
products(name, type, value, date)
Task: Find name from customers where salary exceeds the minimum value from products for the same level.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM products AS prod
WHERE prod.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02744 | train |
v1 | Schema:
customers (alias: cust)(status, value, code, name)
employees(amount, status, salary, name)
Task: Find amount from customers where code appears in employees entries with matching code.
SQL: | SELECT amount FROM customers AS cust
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02745 | train |
v1 | Schema:
invoices (alias: inv)(date, id, salary, amount)
regions(code, salary, level, id)
Task: Retrieve code from invoices whose level is found in regions rows where type matches the outer record.
SQL: | SELECT code FROM invoices AS inv
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02746 | train |
v3 | Schema:
requests (alias: ordr)(salary, date, code, amount)
items(date, type, amount, salary)
Task: Find salary from requests where value exceeds the total value from items for the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM items AS lne
WHERE lne.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02747 | train |
v2 | Schema:
regions (alias: rgn)(salary, name, value, code)
schedules(name, id, code, status)
Task: Retrieve name from regions that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02748 | train |
v2 | Schema:
accounts (alias: acct)(value, date, code, level)
items(value, name, salary, amount)
Task: Find id from accounts where a matching record exists in items with the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02749 | train |
v2 | Schema:
tasks (alias: tsk)(date, level, value, code)
accounts(type, name, level, value)
Task: Retrieve salary from tasks that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02750 | train |
v3 | Schema:
departments (alias: dept)(value, amount, type, id)
accounts(date, salary, amount, code)
Task: Retrieve salary from departments with value above the AVG(salary) of accounts rows sharing the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02751 | train |
v2 | Schema:
orders (alias: ord)(level, type, status, value)
schedules(level, amount, name, status)
Task: Retrieve value from orders that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02752 | train |
v1 | Schema:
categories (alias: catg)(name, type, amount, id)
managers(salary, status, level, id)
Task: Select salary from categories where code exists in managers for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02753 | train |
v1 | Schema:
shipments (alias: shp)(id, code, salary, amount)
customers(salary, type, date, name)
Task: Retrieve salary from shipments whose type is found in customers rows where type matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02754 | train |
v3 | Schema:
transactions (alias: txn)(type, id, amount, level)
categories(date, name, amount, salary)
Task: Retrieve id from transactions with salary above the MAX(amount) of categories rows sharing the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "id",
"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_02755 | train |
v1 | Schema:
departments (alias: dept)(status, date, id, name)
requests(code, type, id, name)
Task: Select code from departments where level exists in requests for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02756 | train |
v3 | Schema:
managers (alias: mgr)(value, type, name, salary)
schedules(date, level, status, type)
Task: Find value from managers where amount exceeds the count of value from schedules for the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02757 | train |
v3 | Schema:
tasks (alias: tsk)(date, status, id, code)
projects(id, amount, level, status)
Task: Retrieve id from tasks with salary above the SUM(value) of projects rows sharing the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE salary > (
SELECT SUM(value) FROM projects AS prj
WHERE prj.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02758 | train |
v2 | Schema:
orders (alias: ord)(type, date, level, value)
customers(level, status, id, type)
Task: Find name from orders where a matching record exists in customers with the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02759 | train |
v1 | Schema:
items (alias: lne)(value, date, status, type)
invoices(amount, value, status, level)
Task: Select name from items where type exists in invoices for the same code.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02760 | train |
v3 | Schema:
employees (alias: emp)(id, salary, date, amount)
accounts(level, status, type, code)
Task: Find name from employees where amount exceeds the maximum amount from accounts for the same status.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02761 | train |
v2 | Schema:
items (alias: lne)(code, amount, type, name)
customers(salary, amount, code, status)
Task: Retrieve id from items that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02762 | train |
v2 | Schema:
regions (alias: rgn)(date, status, salary, name)
transactions(status, salary, amount, level)
Task: Retrieve code from regions that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02763 | train |
v2 | Schema:
departments (alias: dept)(amount, type, id, status)
schedules(name, status, date, code)
Task: Find amount from departments where a matching record exists in schedules with the same level.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02764 | train |
v1 | Schema:
customers (alias: cust)(value, amount, code, id)
requests(status, date, value, type)
Task: Find id from customers where status appears in requests entries with matching code.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02765 | train |
v3 | Schema:
projects (alias: prj)(type, code, value, status)
shipments(id, level, code, amount)
Task: Find code from projects where salary exceeds the total value from shipments for the same code.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02766 | train |
v3 | Schema:
managers (alias: mgr)(name, code, salary, level)
departments(value, salary, code, name)
Task: Find amount from managers where value exceeds the count of salary from departments for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02767 | train |
v1 | Schema:
transactions (alias: txn)(name, date, code, status)
sales(name, type, salary, code)
Task: Retrieve code from transactions whose id is found in sales rows where level matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02768 | train |
v1 | Schema:
employees (alias: emp)(name, amount, value, salary)
orders(type, date, id, salary)
Task: Find id from employees where level appears in orders entries with matching type.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02769 | train |
v3 | Schema:
branches (alias: brc)(level, code, type, date)
staff(code, amount, name, value)
Task: Find id from branches where salary exceeds the maximum amount from staff for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02770 | train |
v3 | Schema:
tasks (alias: tsk)(id, name, amount, type)
items(amount, salary, date, value)
Task: Retrieve code from tasks with salary above the AVG(amount) of items rows sharing the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02771 | train |
v2 | Schema:
transactions (alias: txn)(value, name, code, date)
customers(code, value, date, status)
Task: Find name from transactions where a matching record exists in customers with the same id.
SQL: | SELECT name 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": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02772 | train |
v3 | Schema:
customers (alias: cust)(date, amount, name, code)
categories(salary, status, date, amount)
Task: Find value from customers where amount exceeds the count of value from categories for the same status.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02773 | train |
v2 | Schema:
shipments (alias: shp)(date, id, name, amount)
orders(level, id, value, status)
Task: Retrieve amount from shipments that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02774 | train |
v3 | Schema:
sales (alias: sale)(amount, code, name, status)
requests(name, salary, status, date)
Task: Retrieve value from sales with value above the MIN(amount) of requests rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02775 | train |
v3 | Schema:
schedules (alias: schd)(code, level, salary, status)
branches(type, id, name, status)
Task: Find name from schedules where amount exceeds the total amount from branches for the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02776 | train |
v3 | Schema:
requests (alias: ordr)(salary, status, amount, type)
invoices(salary, value, name, level)
Task: Find code from requests where value exceeds the total value from invoices for the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02777 | train |
v2 | Schema:
branches (alias: brc)(level, amount, name, id)
orders(level, date, salary, amount)
Task: Retrieve amount from branches that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02778 | train |
v2 | Schema:
shipments (alias: shp)(amount, status, name, type)
employees(salary, date, status, id)
Task: Retrieve code from shipments that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02779 | train |
v2 | Schema:
accounts (alias: acct)(salary, name, status, code)
shipments(level, type, date, code)
Task: Retrieve code from accounts that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02780 | train |
v3 | Schema:
projects (alias: prj)(value, status, id, amount)
orders(date, type, amount, level)
Task: Find salary from projects where salary exceeds the average amount from orders for the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02781 | train |
v1 | Schema:
transactions (alias: txn)(value, status, salary, date)
staff(level, status, name, amount)
Task: Select code from transactions where status exists in staff for the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02782 | train |
v3 | Schema:
invoices (alias: inv)(type, value, amount, level)
staff(amount, value, status, level)
Task: Find id from invoices where amount exceeds the average value from staff for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02783 | train |
v3 | Schema:
employees (alias: emp)(value, level, amount, id)
departments(value, type, name, salary)
Task: Find value from employees where salary exceeds the total amount from departments for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02784 | train |
v1 | Schema:
shipments (alias: shp)(value, date, type, id)
transactions(id, status, name, code)
Task: Select amount from shipments where level exists in transactions for the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02785 | train |
v3 | Schema:
staff (alias: empl)(type, id, salary, value)
requests(code, level, amount, id)
Task: Find amount from staff where value exceeds the average amount from requests for the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02786 | train |
v2 | Schema:
accounts (alias: acct)(type, salary, status, value)
tasks(type, value, name, code)
Task: Retrieve code from accounts that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02787 | train |
v1 | Schema:
shipments (alias: shp)(type, level, salary, amount)
requests(value, date, code, salary)
Task: Retrieve amount from shipments whose status is found in requests rows where level matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02788 | train |
v3 | Schema:
invoices (alias: inv)(value, code, name, date)
shipments(name, salary, code, value)
Task: Find code from invoices where amount exceeds the average salary from shipments for the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02789 | train |
v2 | Schema:
items (alias: lne)(code, id, salary, value)
orders(salary, id, date, level)
Task: Find value from items where a matching record exists in orders with the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02790 | train |
v3 | Schema:
categories (alias: catg)(salary, code, type, amount)
projects(date, type, value, status)
Task: Find name from categories where salary exceeds the count of amount from projects for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT COUNT(amount) FROM projects AS prj
WHERE prj.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02791 | train |
v1 | Schema:
items (alias: lne)(type, status, value, amount)
transactions(value, name, status, amount)
Task: Retrieve id from items whose type is found in transactions rows where status matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02792 | train |
v3 | Schema:
requests (alias: ordr)(type, code, status, value)
tasks(code, id, value, status)
Task: Retrieve amount from requests with amount above the SUM(amount) of tasks rows sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT SUM(amount) FROM tasks AS tsk
WHERE tsk.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02793 | train |
v3 | Schema:
products (alias: prod)(code, value, salary, id)
branches(code, type, amount, level)
Task: Find salary from products where value exceeds the maximum salary from branches for the same code.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.code = prod.code
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02794 | train |
v1 | Schema:
requests (alias: ordr)(level, date, value, code)
tasks(level, date, name, status)
Task: Retrieve name from requests whose code is found in tasks rows where id matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02795 | train |
v1 | Schema:
customers (alias: cust)(code, amount, level, name)
schedules(id, amount, code, value)
Task: Select code from customers where id exists in schedules for the same level.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02796 | train |
v1 | Schema:
staff (alias: empl)(salary, type, name, value)
products(code, name, value, salary)
Task: Retrieve name from staff whose level is found in products rows where type matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02797 | train |
v3 | Schema:
accounts (alias: acct)(status, name, value, level)
managers(level, code, date, name)
Task: Retrieve name from accounts with amount above the MIN(amount) of managers rows sharing the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02798 | train |
v1 | Schema:
sales (alias: sale)(level, amount, type, salary)
tasks(status, name, date, id)
Task: Retrieve salary from sales whose code is found in tasks rows where code matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.