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:
tasks (alias: tsk)(id, value, amount, name)
requests(level, code, value, status)
Task: Retrieve code from tasks with salary above the MAX(salary) of requests rows sharing the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13700 | train |
v2 | Schema:
customers (alias: cust)(name, salary, value, type)
tasks(type, id, date, name)
Task: Retrieve code from customers that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13701 | train |
v3 | Schema:
transactions (alias: txn)(date, salary, status, value)
invoices(level, code, status, value)
Task: Retrieve value from transactions with salary above the COUNT(amount) of invoices rows sharing the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13702 | train |
v3 | Schema:
employees (alias: emp)(date, salary, amount, code)
categories(code, id, name, level)
Task: Find code from employees where amount exceeds the total value from categories for the same id.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13703 | train |
v1 | Schema:
regions (alias: rgn)(status, code, salary, id)
customers(level, code, salary, date)
Task: Select id from regions where code exists in customers for the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13704 | train |
v3 | Schema:
branches (alias: brc)(date, value, id, level)
products(id, date, level, value)
Task: Retrieve code from branches with value above the MAX(salary) of products rows sharing the same code.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT MAX(salary) FROM products AS prod
WHERE prod.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13705 | train |
v3 | Schema:
branches (alias: brc)(type, value, salary, level)
items(value, level, status, type)
Task: Find id from branches where value exceeds the count of value from items for the same code.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13706 | train |
v2 | Schema:
projects (alias: prj)(value, type, amount, name)
requests(amount, date, name, level)
Task: Retrieve name from projects that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13707 | train |
v2 | Schema:
sales (alias: sale)(date, level, value, code)
orders(amount, id, name, date)
Task: Retrieve id from sales that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13708 | train |
v3 | Schema:
staff (alias: empl)(code, id, date, salary)
orders(salary, level, id, value)
Task: Retrieve id from staff with amount above the AVG(value) of orders rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13709 | train |
v3 | Schema:
products (alias: prod)(id, code, type, value)
branches(code, level, amount, date)
Task: Find amount from products where salary exceeds the maximum salary from branches for the same type.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.type = prod.type
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13710 | train |
v3 | Schema:
categories (alias: catg)(type, date, status, level)
regions(date, amount, status, name)
Task: Retrieve value from categories with value above the MIN(salary) of regions rows sharing the same id.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13711 | train |
v3 | Schema:
customers (alias: cust)(amount, date, id, salary)
employees(type, amount, value, status)
Task: Find value from customers where value exceeds the count of salary from employees for the same type.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13712 | train |
v2 | Schema:
requests (alias: ordr)(salary, amount, id, name)
customers(date, level, status, name)
Task: Find id from requests where a matching record exists in customers with the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13713 | train |
v2 | Schema:
managers (alias: mgr)(code, salary, value, amount)
schedules(type, status, code, name)
Task: Find name from managers where a matching record exists in schedules with the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13714 | train |
v3 | Schema:
invoices (alias: inv)(id, status, code, type)
accounts(type, code, id, value)
Task: Find salary from invoices where value exceeds the average salary from accounts for the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13715 | train |
v3 | Schema:
transactions (alias: txn)(salary, type, date, amount)
employees(code, salary, amount, value)
Task: Find id from transactions where salary exceeds the minimum value from employees for the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13716 | train |
v2 | Schema:
shipments (alias: shp)(type, date, value, level)
requests(level, name, type, date)
Task: Find code from shipments where a matching record exists in requests with the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13717 | train |
v2 | Schema:
items (alias: lne)(level, code, id, amount)
projects(salary, level, status, code)
Task: Retrieve code from items that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = lne.code
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13718 | train |
v1 | Schema:
requests (alias: ordr)(code, name, status, salary)
departments(level, name, code, id)
Task: Select amount from requests where level exists in departments for the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13719 | train |
v3 | Schema:
schedules (alias: schd)(date, id, amount, status)
projects(date, code, level, status)
Task: Retrieve id from schedules with salary above the SUM(amount) of projects rows sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13720 | train |
v3 | Schema:
shipments (alias: shp)(code, salary, id, name)
employees(date, amount, value, id)
Task: Find code from shipments where salary exceeds the count of salary from employees for the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13721 | train |
v1 | Schema:
transactions (alias: txn)(name, status, id, type)
employees(name, id, code, date)
Task: Retrieve salary from transactions whose type is found in employees rows where level matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13722 | train |
v3 | Schema:
categories (alias: catg)(name, code, id, status)
accounts(amount, id, value, code)
Task: Find value from categories where amount exceeds the count of salary from accounts for the same level.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13723 | train |
v2 | Schema:
transactions (alias: txn)(type, value, id, level)
managers(id, date, salary, level)
Task: Retrieve name from transactions that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13724 | train |
v2 | Schema:
regions (alias: rgn)(id, status, name, type)
categories(code, value, name, date)
Task: Retrieve name from regions that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13725 | train |
v1 | Schema:
schedules (alias: schd)(id, date, level, name)
regions(code, type, value, level)
Task: Select name from schedules where code exists in regions for the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13726 | train |
v1 | Schema:
regions (alias: rgn)(date, salary, name, code)
items(type, name, id, date)
Task: Find value from regions where code appears in items entries with matching level.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13727 | train |
v1 | Schema:
items (alias: lne)(value, level, type, amount)
invoices(level, id, status, salary)
Task: Retrieve name from items whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13728 | train |
v2 | Schema:
staff (alias: empl)(type, id, code, level)
projects(type, id, value, status)
Task: Find code from staff where a matching record exists in projects with the same level.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13729 | train |
v1 | Schema:
categories (alias: catg)(type, level, id, code)
employees(value, name, code, date)
Task: Find salary from categories where code appears in employees entries with matching status.
SQL: | SELECT salary FROM categories AS catg
WHERE code IN (
SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13730 | train |
v1 | Schema:
products (alias: prod)(value, salary, name, date)
sales(type, status, name, id)
Task: Select code from products where type exists in sales for the same code.
SQL: | SELECT code FROM products AS prod
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13731 | train |
v1 | Schema:
categories (alias: catg)(name, value, type, status)
orders(type, status, date, value)
Task: Retrieve salary from categories whose status is found in orders rows where status matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13732 | train |
v1 | Schema:
accounts (alias: acct)(type, name, status, salary)
employees(value, code, name, salary)
Task: Select name from accounts where level exists in employees for the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13733 | train |
v2 | Schema:
sales (alias: sale)(level, value, status, amount)
managers(value, date, name, amount)
Task: Retrieve salary from sales that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13734 | train |
v2 | Schema:
sales (alias: sale)(date, id, salary, status)
departments(value, id, salary, amount)
Task: Retrieve name from sales that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13735 | train |
v1 | Schema:
customers (alias: cust)(value, amount, name, salary)
products(id, date, level, name)
Task: Select id from customers where id exists in products for the same level.
SQL: | SELECT id FROM customers AS cust
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13736 | train |
v1 | Schema:
managers (alias: mgr)(salary, amount, id, code)
categories(amount, level, type, date)
Task: Select salary from managers where code exists in categories for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13737 | train |
v1 | Schema:
accounts (alias: acct)(type, id, date, amount)
managers(status, value, amount, code)
Task: Find value from accounts where id appears in managers entries with matching code.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13738 | train |
v2 | Schema:
sales (alias: sale)(id, type, amount, code)
requests(level, name, amount, date)
Task: Retrieve code from sales that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13739 | train |
v2 | Schema:
items (alias: lne)(salary, level, type, name)
schedules(type, amount, date, status)
Task: Find amount from items where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13740 | train |
v2 | Schema:
sales (alias: sale)(salary, status, id, name)
managers(id, value, code, type)
Task: Retrieve id from sales that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13741 | train |
v1 | Schema:
schedules (alias: schd)(date, status, type, code)
products(value, id, name, amount)
Task: Retrieve salary from schedules whose id is found in products rows where status matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13742 | train |
v2 | Schema:
managers (alias: mgr)(type, salary, date, name)
customers(value, name, level, amount)
Task: Find amount from managers where a matching record exists in customers with the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13743 | train |
v3 | Schema:
categories (alias: catg)(name, date, salary, code)
shipments(status, name, value, salary)
Task: Retrieve amount from categories with salary above the MIN(value) of shipments rows sharing the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13744 | train |
v3 | Schema:
customers (alias: cust)(level, status, name, code)
orders(level, date, amount, code)
Task: Find salary from customers where value exceeds the total amount from orders for the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13745 | train |
v2 | Schema:
branches (alias: brc)(salary, type, level, name)
employees(date, value, level, id)
Task: Retrieve amount from branches that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13746 | train |
v3 | Schema:
orders (alias: ord)(amount, id, type, name)
shipments(status, salary, value, level)
Task: Find code from orders where value exceeds the minimum salary from shipments for the same status.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13747 | train |
v2 | Schema:
tasks (alias: tsk)(type, date, code, amount)
managers(name, code, value, level)
Task: Retrieve amount from tasks that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13748 | train |
v1 | Schema:
customers (alias: cust)(status, level, salary, id)
accounts(salary, value, amount, date)
Task: Find salary from customers where level appears in accounts entries with matching code.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13749 | train |
v2 | Schema:
sales (alias: sale)(salary, level, code, status)
items(code, type, salary, level)
Task: Find code from sales where a matching record exists in items with the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13750 | train |
v1 | Schema:
categories (alias: catg)(status, salary, code, level)
transactions(amount, level, value, salary)
Task: Select code from categories where code exists in transactions for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13751 | train |
v1 | Schema:
sales (alias: sale)(date, name, amount, type)
departments(date, status, name, level)
Task: Retrieve amount from sales whose level is found in departments rows where id matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13752 | train |
v2 | Schema:
orders (alias: ord)(level, name, id, status)
products(type, salary, code, id)
Task: Find value from orders where a matching record exists in products with the same code.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13753 | train |
v1 | Schema:
orders (alias: ord)(type, amount, code, value)
employees(salary, type, name, code)
Task: Select id from orders where code exists in employees for the same status.
SQL: | SELECT id FROM orders AS ord
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13754 | train |
v3 | Schema:
sales (alias: sale)(amount, name, salary, date)
items(value, code, salary, name)
Task: Retrieve code from sales with salary above the SUM(value) of items rows sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT SUM(value) FROM items AS lne
WHERE lne.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13755 | train |
v3 | Schema:
staff (alias: empl)(id, value, level, amount)
tasks(value, date, salary, amount)
Task: Find salary from staff where value exceeds the average value from tasks for the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE value > (
SELECT AVG(value) FROM tasks AS tsk
WHERE tsk.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13756 | train |
v1 | Schema:
departments (alias: dept)(id, type, value, salary)
sales(salary, type, id, value)
Task: Select salary from departments where code exists in sales for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13757 | train |
v2 | Schema:
transactions (alias: txn)(salary, type, status, name)
accounts(level, name, id, amount)
Task: Retrieve salary from transactions that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13758 | train |
v3 | Schema:
invoices (alias: inv)(salary, date, level, value)
accounts(value, salary, amount, level)
Task: Find amount from invoices where salary exceeds the minimum salary from accounts for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13759 | train |
v1 | Schema:
customers (alias: cust)(type, status, date, level)
requests(id, salary, date, code)
Task: Select name from customers where level exists in requests for the same id.
SQL: | SELECT name FROM customers AS cust
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13760 | train |
v2 | Schema:
schedules (alias: schd)(id, value, type, code)
requests(code, value, id, name)
Task: Retrieve name from schedules that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13761 | train |
v3 | Schema:
categories (alias: catg)(level, salary, date, type)
customers(code, amount, level, value)
Task: Retrieve name from categories with salary above the MAX(amount) of customers rows sharing the same level.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13762 | train |
v3 | Schema:
items (alias: lne)(id, level, salary, status)
projects(level, value, status, date)
Task: Find salary from items where amount exceeds the average value from projects for the same level.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.level = lne.level
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13763 | train |
v3 | Schema:
branches (alias: brc)(id, level, date, value)
schedules(date, status, salary, id)
Task: Find value from branches where value exceeds the count of salary from schedules for the same id.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13764 | train |
v2 | Schema:
managers (alias: mgr)(status, name, type, salary)
schedules(date, name, level, code)
Task: Retrieve value from managers that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13765 | train |
v1 | Schema:
staff (alias: empl)(salary, level, id, name)
regions(level, value, type, id)
Task: Find salary from staff where level appears in regions entries with matching code.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13766 | train |
v2 | Schema:
customers (alias: cust)(status, value, type, date)
tasks(amount, value, level, name)
Task: Retrieve salary from customers that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13767 | train |
v1 | Schema:
employees (alias: emp)(salary, id, amount, value)
items(level, salary, name, status)
Task: Find code from employees where code appears in items entries with matching id.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13768 | train |
v2 | Schema:
categories (alias: catg)(type, salary, value, name)
requests(value, type, name, date)
Task: Find name from categories where a matching record exists in requests with the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13769 | train |
v1 | Schema:
transactions (alias: txn)(code, type, name, date)
branches(value, salary, type, code)
Task: Select amount from transactions where code exists in branches for the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13770 | train |
v1 | Schema:
requests (alias: ordr)(date, status, value, level)
invoices(id, salary, value, date)
Task: Find amount from requests where level appears in invoices entries with matching level.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13771 | train |
v3 | Schema:
sales (alias: sale)(code, amount, status, date)
invoices(salary, name, status, type)
Task: Find value from sales where value exceeds the total amount from invoices for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13772 | train |
v2 | Schema:
shipments (alias: shp)(code, type, status, value)
schedules(id, code, amount, type)
Task: Find value from shipments where a matching record exists in schedules with the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13773 | train |
v2 | Schema:
items (alias: lne)(status, level, code, id)
invoices(value, amount, type, name)
Task: Find id from items where a matching record exists in invoices with the same id.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13774 | train |
v2 | Schema:
staff (alias: empl)(type, name, id, status)
regions(id, type, code, level)
Task: Find id from staff where a matching record exists in regions with the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13775 | train |
v1 | Schema:
regions (alias: rgn)(status, salary, name, type)
customers(id, date, salary, level)
Task: Retrieve id from regions whose code is found in customers rows where level matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13776 | train |
v1 | Schema:
employees (alias: emp)(id, amount, salary, status)
tasks(name, salary, amount, level)
Task: Select value from employees where level exists in tasks for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13777 | train |
v2 | Schema:
schedules (alias: schd)(value, level, id, amount)
products(level, name, id, date)
Task: Retrieve name from schedules that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13778 | train |
v2 | Schema:
orders (alias: ord)(type, level, name, value)
regions(name, salary, value, date)
Task: Retrieve name from orders that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13779 | train |
v3 | Schema:
customers (alias: cust)(salary, id, amount, value)
invoices(code, value, level, id)
Task: Retrieve salary from customers with salary above the SUM(salary) of invoices rows sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13780 | train |
v1 | Schema:
sales (alias: sale)(level, status, salary, date)
managers(date, salary, type, status)
Task: Retrieve amount from sales whose level is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13781 | train |
v3 | Schema:
schedules (alias: schd)(code, type, date, name)
accounts(code, date, amount, id)
Task: Retrieve amount from schedules with amount above the SUM(amount) of accounts rows sharing the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13782 | train |
v3 | Schema:
orders (alias: ord)(date, name, status, id)
requests(id, salary, value, code)
Task: Retrieve id from orders with value above the MAX(salary) of requests rows sharing the same level.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13783 | train |
v1 | Schema:
schedules (alias: schd)(date, name, salary, status)
orders(type, level, salary, amount)
Task: Select salary from schedules where level exists in orders for the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13784 | train |
v3 | Schema:
managers (alias: mgr)(type, salary, value, code)
regions(value, id, status, type)
Task: Find value from managers where salary exceeds the count of salary from regions for the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13785 | train |
v1 | Schema:
items (alias: lne)(salary, name, date, amount)
transactions(status, amount, type, code)
Task: Find salary from items where id appears in transactions entries with matching level.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13786 | train |
v1 | Schema:
categories (alias: catg)(date, status, id, value)
shipments(date, code, amount, salary)
Task: Select id from categories where id exists in shipments for the same code.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13787 | train |
v2 | Schema:
shipments (alias: shp)(salary, id, date, level)
accounts(amount, type, status, value)
Task: Retrieve name from shipments that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13788 | train |
v2 | Schema:
projects (alias: prj)(code, level, name, status)
sales(status, level, salary, code)
Task: Find name from projects where a matching record exists in sales with the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13789 | train |
v3 | Schema:
schedules (alias: schd)(amount, code, status, id)
orders(value, type, code, salary)
Task: Retrieve salary from schedules with value above the MIN(amount) of orders rows sharing the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT MIN(amount) FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13790 | train |
v3 | Schema:
invoices (alias: inv)(id, salary, status, code)
accounts(level, code, id, value)
Task: Retrieve amount from invoices with value above the COUNT(value) of accounts rows sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13791 | train |
v3 | Schema:
sales (alias: sale)(value, status, code, level)
categories(level, id, name, code)
Task: Retrieve salary from sales with amount above the COUNT(amount) of categories rows sharing the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13792 | train |
v2 | Schema:
categories (alias: catg)(value, type, level, salary)
orders(id, date, code, type)
Task: Retrieve value from categories that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13793 | train |
v1 | Schema:
projects (alias: prj)(id, date, status, level)
products(level, value, date, amount)
Task: Select value from projects where id exists in products for the same code.
SQL: | SELECT value FROM projects AS prj
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13794 | train |
v3 | Schema:
regions (alias: rgn)(value, type, id, code)
schedules(date, value, level, name)
Task: Find amount from regions where amount exceeds the average value from schedules for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13795 | train |
v3 | Schema:
staff (alias: empl)(type, status, date, level)
orders(date, code, amount, status)
Task: Find salary from staff where amount exceeds the total value from orders for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13796 | train |
v3 | Schema:
items (alias: lne)(id, status, name, salary)
branches(status, level, amount, name)
Task: Find value from items where value exceeds the maximum salary from branches for the same level.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13797 | train |
v1 | Schema:
tasks (alias: tsk)(name, code, salary, id)
branches(type, code, date, amount)
Task: Select amount from tasks where level exists in branches for the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13798 | train |
v1 | Schema:
requests (alias: ordr)(value, status, type, salary)
sales(amount, level, value, salary)
Task: Find salary from requests where code appears in sales entries with matching code.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.