variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
regions (alias: rgn)(name, date, code, status)
invoices(name, code, date, value)
Task: Retrieve code from regions with amount above the COUNT(value) of invoices rows sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07700 | train |
v2 | Schema:
products (alias: prod)(code, date, status, type)
invoices(date, amount, id, name)
Task: Find id from products where a matching record exists in invoices with the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = prod.type
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07701 | train |
v3 | Schema:
branches (alias: brc)(value, id, name, amount)
managers(name, status, amount, id)
Task: Find amount from branches where amount exceeds the average salary from managers for the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07702 | train |
v3 | Schema:
branches (alias: brc)(date, id, amount, code)
staff(code, value, level, type)
Task: Retrieve amount from branches with amount above the MIN(salary) of staff rows sharing the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07703 | train |
v2 | Schema:
schedules (alias: schd)(amount, date, id, type)
items(amount, id, name, code)
Task: Retrieve value from schedules that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07704 | train |
v1 | Schema:
schedules (alias: schd)(amount, type, date, salary)
shipments(value, id, amount, status)
Task: Select salary from schedules where code exists in shipments for the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07705 | train |
v2 | Schema:
accounts (alias: acct)(amount, code, type, name)
projects(type, status, level, id)
Task: Find value from accounts where a matching record exists in projects with the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07706 | train |
v2 | Schema:
categories (alias: catg)(name, id, value, code)
branches(date, type, code, id)
Task: Find code from categories where a matching record exists in branches with the same code.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07707 | train |
v3 | Schema:
staff (alias: empl)(id, date, level, type)
schedules(id, type, code, date)
Task: Retrieve code from staff with value above the SUM(salary) of schedules rows sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE value > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07708 | train |
v2 | Schema:
managers (alias: mgr)(name, amount, status, type)
sales(status, amount, value, level)
Task: Retrieve value from managers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07709 | train |
v1 | Schema:
tasks (alias: tsk)(code, level, value, salary)
schedules(date, code, value, salary)
Task: Select amount from tasks where type exists in schedules for the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07710 | train |
v2 | Schema:
requests (alias: ordr)(code, date, value, salary)
employees(code, status, type, id)
Task: Retrieve salary from requests that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07711 | train |
v2 | Schema:
items (alias: lne)(code, id, status, date)
customers(type, id, code, name)
Task: Find salary from items where a matching record exists in customers with the same id.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07712 | train |
v2 | Schema:
managers (alias: mgr)(code, date, level, value)
projects(level, amount, type, status)
Task: Find amount from managers where a matching record exists in projects with the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07713 | train |
v3 | Schema:
branches (alias: brc)(amount, status, code, id)
departments(salary, type, value, level)
Task: Retrieve code from branches with salary above the MIN(value) of departments rows sharing the same code.
SQL: | SELECT code FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07714 | train |
v2 | Schema:
staff (alias: empl)(amount, name, id, salary)
departments(status, value, name, amount)
Task: Retrieve amount from staff that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07715 | train |
v2 | Schema:
requests (alias: ordr)(code, level, date, id)
branches(id, level, value, type)
Task: Retrieve salary from requests that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07716 | train |
v2 | Schema:
schedules (alias: schd)(date, amount, code, salary)
customers(code, salary, amount, id)
Task: Find name from schedules where a matching record exists in customers with the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07717 | train |
v1 | Schema:
regions (alias: rgn)(status, name, type, level)
managers(status, amount, code, type)
Task: Find id from regions where id appears in managers entries with matching id.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07718 | train |
v2 | Schema:
requests (alias: ordr)(code, type, name, salary)
categories(date, value, id, status)
Task: Find amount from requests where a matching record exists in categories with the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07719 | train |
v1 | Schema:
employees (alias: emp)(id, amount, name, code)
customers(status, name, amount, id)
Task: Retrieve salary from employees whose type is found in customers rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07720 | train |
v2 | Schema:
regions (alias: rgn)(type, date, amount, name)
employees(id, type, amount, value)
Task: Find value from regions where a matching record exists in employees with the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07721 | train |
v3 | Schema:
items (alias: lne)(level, amount, code, status)
categories(status, value, type, salary)
Task: Retrieve id from items with value above the AVG(salary) of categories rows sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07722 | train |
v1 | Schema:
invoices (alias: inv)(salary, value, name, date)
requests(date, amount, code, id)
Task: Find id from invoices where type appears in requests entries with matching status.
SQL: | SELECT id FROM invoices AS inv
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07723 | train |
v2 | Schema:
managers (alias: mgr)(type, level, salary, date)
branches(name, date, code, salary)
Task: Retrieve code from managers that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07724 | train |
v3 | Schema:
requests (alias: ordr)(date, id, amount, type)
invoices(level, id, code, salary)
Task: Retrieve value from requests with amount above the MAX(value) of invoices rows sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07725 | train |
v3 | Schema:
departments (alias: dept)(salary, amount, value, name)
transactions(value, level, id, salary)
Task: Find code from departments where value exceeds the minimum amount from transactions for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07726 | train |
v3 | Schema:
schedules (alias: schd)(status, date, salary, code)
branches(level, code, value, salary)
Task: Find id from schedules where value exceeds the minimum value from branches for the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07727 | train |
v2 | Schema:
orders (alias: ord)(salary, date, type, id)
departments(level, name, value, amount)
Task: Find value from orders where a matching record exists in departments with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07728 | train |
v2 | Schema:
staff (alias: empl)(date, level, name, amount)
departments(code, name, level, date)
Task: Retrieve id from staff that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07729 | train |
v3 | Schema:
invoices (alias: inv)(value, amount, name, level)
orders(value, date, code, id)
Task: Retrieve value from invoices with salary above the COUNT(value) of orders rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07730 | train |
v1 | Schema:
orders (alias: ord)(name, value, status, code)
managers(salary, id, amount, status)
Task: Find value from orders where code appears in managers entries with matching code.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07731 | train |
v3 | Schema:
managers (alias: mgr)(value, name, salary, status)
items(date, status, amount, salary)
Task: Find value from managers where salary exceeds the count of value from items for the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07732 | train |
v3 | Schema:
employees (alias: emp)(salary, id, date, level)
staff(date, code, amount, value)
Task: Find name from employees where amount exceeds the average amount from staff for the same type.
SQL: | SELECT name FROM employees AS emp
WHERE amount > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07733 | train |
v1 | Schema:
employees (alias: emp)(code, amount, name, level)
regions(code, level, amount, value)
Task: Retrieve id from employees whose id is found in regions rows where status matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07734 | train |
v1 | Schema:
managers (alias: mgr)(salary, level, amount, status)
shipments(status, amount, name, level)
Task: Retrieve code from managers whose code is found in shipments rows where level matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07735 | train |
v3 | Schema:
schedules (alias: schd)(id, value, type, name)
invoices(value, id, amount, salary)
Task: Find code from schedules where amount exceeds the maximum salary from invoices for the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07736 | train |
v3 | Schema:
staff (alias: empl)(salary, amount, date, id)
accounts(date, level, code, name)
Task: Find id from staff where salary exceeds the total amount from accounts for the same status.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07737 | train |
v1 | Schema:
sales (alias: sale)(date, name, level, salary)
customers(type, level, value, code)
Task: Select name from sales where status exists in customers for the same type.
SQL: | SELECT name FROM sales AS sale
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07738 | train |
v2 | Schema:
accounts (alias: acct)(code, id, date, name)
transactions(status, id, date, amount)
Task: Find value from accounts where a matching record exists in transactions with the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07739 | train |
v3 | Schema:
transactions (alias: txn)(date, level, id, amount)
branches(type, status, amount, code)
Task: Find name from transactions where salary exceeds the average salary from branches for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07740 | train |
v3 | Schema:
requests (alias: ordr)(date, salary, amount, name)
shipments(code, name, id, amount)
Task: Find code from requests where value exceeds the average salary from shipments for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07741 | train |
v1 | Schema:
requests (alias: ordr)(status, type, amount, date)
customers(salary, code, id, status)
Task: Find value from requests where status appears in customers entries with matching status.
SQL: | SELECT value FROM requests AS ordr
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07742 | train |
v3 | Schema:
branches (alias: brc)(id, name, type, value)
orders(amount, salary, status, date)
Task: Find value from branches where value exceeds the total value from orders for the same status.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07743 | train |
v3 | Schema:
schedules (alias: schd)(name, type, code, status)
tasks(level, value, salary, code)
Task: Find salary from schedules where salary exceeds the minimum salary from tasks for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07744 | train |
v3 | Schema:
transactions (alias: txn)(code, value, salary, id)
categories(value, type, id, level)
Task: Retrieve amount from transactions with salary above the SUM(amount) of categories rows sharing the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07745 | train |
v2 | Schema:
sales (alias: sale)(level, value, salary, date)
departments(level, value, type, amount)
Task: Retrieve value from sales that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07746 | train |
v2 | Schema:
regions (alias: rgn)(code, amount, date, name)
requests(level, value, name, code)
Task: Retrieve salary from regions that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07747 | train |
v1 | Schema:
employees (alias: emp)(status, code, value, salary)
invoices(code, amount, id, name)
Task: Retrieve code from employees whose code is found in invoices rows where id matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07748 | train |
v1 | Schema:
managers (alias: mgr)(name, type, level, code)
categories(name, level, value, status)
Task: Retrieve code from managers whose level is found in categories rows where type matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07749 | train |
v2 | Schema:
tasks (alias: tsk)(id, salary, amount, status)
projects(name, salary, status, level)
Task: Find id from tasks where a matching record exists in projects with the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07750 | train |
v1 | Schema:
orders (alias: ord)(amount, name, value, id)
customers(type, date, value, level)
Task: Retrieve code from orders whose type is found in customers rows where code matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07751 | train |
v1 | Schema:
departments (alias: dept)(name, date, code, type)
employees(value, type, amount, name)
Task: Find id from departments where id appears in employees entries with matching status.
SQL: | SELECT id FROM departments AS dept
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07752 | train |
v3 | Schema:
requests (alias: ordr)(name, id, level, type)
shipments(value, code, amount, salary)
Task: Find id from requests where value exceeds the average value from shipments for the same code.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07753 | train |
v3 | Schema:
accounts (alias: acct)(code, level, name, type)
transactions(id, value, code, type)
Task: Retrieve name from accounts with salary above the AVG(value) of transactions rows sharing the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07754 | train |
v3 | Schema:
managers (alias: mgr)(status, value, name, level)
invoices(amount, name, salary, value)
Task: Retrieve code from managers with value above the MIN(value) of invoices rows sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07755 | train |
v3 | Schema:
departments (alias: dept)(type, amount, date, salary)
requests(type, date, name, salary)
Task: Find amount from departments where value exceeds the total value from requests for the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07756 | train |
v1 | Schema:
employees (alias: emp)(amount, value, salary, type)
managers(salary, type, value, date)
Task: Find id from employees where status appears in managers entries with matching status.
SQL: | SELECT id FROM employees AS emp
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07757 | train |
v2 | Schema:
departments (alias: dept)(name, level, type, amount)
branches(id, value, code, date)
Task: Find salary from departments where a matching record exists in branches with the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07758 | train |
v1 | Schema:
departments (alias: dept)(id, status, salary, date)
projects(code, type, id, name)
Task: Select name from departments where status exists in projects for the same code.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07759 | train |
v2 | Schema:
projects (alias: prj)(amount, date, code, level)
products(amount, status, value, code)
Task: Find amount from projects where a matching record exists in products with the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07760 | train |
v2 | Schema:
products (alias: prod)(date, id, salary, amount)
items(status, name, amount, level)
Task: Retrieve id from products that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = prod.status
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07761 | train |
v2 | Schema:
sales (alias: sale)(code, id, amount, type)
customers(value, salary, level, amount)
Task: Find name from sales where a matching record exists in customers with the same level.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07762 | train |
v3 | Schema:
departments (alias: dept)(date, id, name, code)
projects(amount, date, code, value)
Task: Find code from departments where amount exceeds the maximum salary from projects for the same type.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07763 | train |
v2 | Schema:
regions (alias: rgn)(type, salary, level, date)
managers(salary, code, amount, type)
Task: Find amount from regions where a matching record exists in managers with the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07764 | train |
v3 | Schema:
departments (alias: dept)(salary, type, date, name)
sales(salary, date, amount, level)
Task: Find code from departments where amount exceeds the count of salary from sales for the same status.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07765 | train |
v3 | Schema:
regions (alias: rgn)(amount, code, name, status)
staff(type, name, amount, status)
Task: Find code from regions where amount exceeds the minimum amount from staff for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07766 | train |
v3 | Schema:
shipments (alias: shp)(status, value, code, name)
departments(type, level, name, status)
Task: Find id from shipments where amount exceeds the minimum value from departments for the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE amount > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07767 | train |
v2 | Schema:
staff (alias: empl)(code, id, level, amount)
requests(amount, name, type, level)
Task: Find name from staff where a matching record exists in requests with the same type.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07768 | train |
v2 | Schema:
products (alias: prod)(amount, name, date, level)
shipments(name, id, level, type)
Task: Retrieve salary from products that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT salary 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": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07769 | train |
v1 | Schema:
sales (alias: sale)(date, type, name, id)
requests(type, amount, salary, id)
Task: Retrieve amount from sales whose level is found in requests rows where status matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07770 | train |
v3 | Schema:
shipments (alias: shp)(value, code, id, name)
managers(salary, type, value, id)
Task: Find code from shipments where amount exceeds the maximum amount from managers for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07771 | train |
v3 | Schema:
shipments (alias: shp)(type, status, amount, id)
accounts(date, value, salary, amount)
Task: Retrieve id from shipments with value above the MAX(salary) of accounts rows sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07772 | train |
v3 | Schema:
shipments (alias: shp)(id, value, salary, status)
branches(value, status, type, level)
Task: Find name from shipments where salary exceeds the total value from branches for the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07773 | train |
v2 | Schema:
transactions (alias: txn)(status, id, value, salary)
departments(code, status, name, date)
Task: Find amount from transactions where a matching record exists in departments with the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07774 | train |
v1 | Schema:
orders (alias: ord)(code, name, type, status)
requests(salary, name, level, date)
Task: Find name from orders where code appears in requests entries with matching status.
SQL: | SELECT name FROM orders AS ord
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07775 | train |
v1 | Schema:
items (alias: lne)(name, code, id, level)
customers(id, amount, date, status)
Task: Select name from items where level exists in customers for the same type.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07776 | train |
v1 | Schema:
regions (alias: rgn)(salary, date, type, amount)
employees(salary, date, id, status)
Task: Select value from regions where code exists in employees for the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07777 | train |
v2 | Schema:
shipments (alias: shp)(code, amount, salary, type)
transactions(type, value, salary, name)
Task: Find id from shipments where a matching record exists in transactions with the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07778 | train |
v2 | Schema:
tasks (alias: tsk)(code, amount, salary, level)
transactions(amount, name, salary, code)
Task: Find salary from tasks where a matching record exists in transactions with the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07779 | train |
v3 | Schema:
shipments (alias: shp)(name, type, level, date)
schedules(id, value, status, amount)
Task: Find id from shipments where salary exceeds the count of amount from schedules for the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07780 | train |
v1 | Schema:
departments (alias: dept)(value, code, date, status)
customers(level, id, code, type)
Task: Retrieve value from departments whose status is found in customers rows where code matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07781 | train |
v2 | Schema:
orders (alias: ord)(name, id, code, type)
tasks(code, status, type, date)
Task: Find salary from orders where a matching record exists in tasks with the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07782 | train |
v1 | Schema:
regions (alias: rgn)(status, value, amount, level)
shipments(amount, value, level, id)
Task: Find code from regions where status appears in shipments entries with matching status.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07783 | train |
v1 | Schema:
transactions (alias: txn)(value, id, code, type)
managers(id, status, value, amount)
Task: Retrieve code from transactions whose id is found in managers rows where id matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07784 | train |
v3 | Schema:
products (alias: prod)(level, name, status, salary)
customers(id, amount, date, salary)
Task: Find salary from products where value exceeds the count of amount from customers for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07785 | train |
v3 | Schema:
schedules (alias: schd)(code, amount, date, status)
projects(id, value, level, type)
Task: Retrieve name from schedules with amount above the AVG(value) of projects rows sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE amount > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07786 | train |
v2 | Schema:
staff (alias: empl)(code, level, status, id)
schedules(amount, level, status, code)
Task: Find salary from staff where a matching record exists in schedules with the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07787 | train |
v1 | Schema:
staff (alias: empl)(id, level, amount, name)
shipments(level, name, date, value)
Task: Retrieve id from staff whose id is found in shipments rows where id matches the outer record.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07788 | train |
v2 | Schema:
schedules (alias: schd)(id, status, date, level)
managers(code, level, id, value)
Task: Retrieve salary from schedules that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07789 | train |
v3 | Schema:
items (alias: lne)(value, type, level, amount)
categories(amount, status, level, name)
Task: Find name from items where value exceeds the minimum value from categories for the same type.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07790 | train |
v3 | Schema:
shipments (alias: shp)(salary, value, level, code)
projects(date, amount, level, value)
Task: Retrieve code from shipments with salary above the AVG(value) of projects rows sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07791 | train |
v1 | Schema:
orders (alias: ord)(status, id, code, date)
customers(value, date, amount, level)
Task: Find name from orders where id appears in customers entries with matching code.
SQL: | SELECT name FROM orders AS ord
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07792 | train |
v2 | Schema:
managers (alias: mgr)(amount, status, salary, name)
regions(code, name, date, value)
Task: Retrieve id from managers that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07793 | train |
v3 | Schema:
requests (alias: ordr)(level, value, date, amount)
items(type, date, salary, status)
Task: Find id from requests where value exceeds the maximum amount from items for the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE value > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07794 | train |
v1 | Schema:
managers (alias: mgr)(date, status, type, code)
schedules(status, salary, code, name)
Task: Retrieve code from managers whose status is found in schedules rows where status matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07795 | train |
v2 | Schema:
orders (alias: ord)(level, type, code, value)
regions(date, id, value, level)
Task: Retrieve amount from orders that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07796 | train |
v2 | Schema:
items (alias: lne)(id, salary, date, value)
requests(salary, amount, date, id)
Task: Retrieve id from items that have at least one corresponding entry in requests sharing the same type.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07797 | train |
v1 | Schema:
departments (alias: dept)(salary, value, status, amount)
managers(value, salary, level, date)
Task: Select value from departments where code exists in managers for the same status.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07798 | train |
v3 | Schema:
schedules (alias: schd)(level, id, name, type)
regions(amount, level, id, salary)
Task: Retrieve name from schedules with salary above the AVG(amount) of regions rows sharing the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT AVG(amount) FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.