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 |
|---|---|---|---|---|---|---|
v2 | Schema:
categories (alias: catg)(code, date, value, id)
products(amount, code, id, name)
Task: Retrieve amount from categories that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12700 | train |
v1 | Schema:
transactions (alias: txn)(value, type, id, level)
customers(salary, amount, id, value)
Task: Select name from transactions where id exists in customers for the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12701 | train |
v3 | Schema:
schedules (alias: schd)(value, amount, date, code)
departments(type, value, status, salary)
Task: Find value from schedules where amount exceeds the minimum value from departments for the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE amount > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12702 | train |
v1 | Schema:
transactions (alias: txn)(code, salary, amount, value)
shipments(id, code, name, type)
Task: Select salary from transactions where type exists in shipments for the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12703 | train |
v3 | Schema:
branches (alias: brc)(level, name, code, type)
products(type, code, salary, value)
Task: Retrieve id from branches with value above the AVG(value) of products rows sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT AVG(value) FROM products AS prod
WHERE prod.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12704 | train |
v1 | Schema:
items (alias: lne)(amount, value, id, date)
customers(amount, salary, level, id)
Task: Select value from items where level exists in customers for the same type.
SQL: | SELECT value 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": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12705 | train |
v3 | Schema:
requests (alias: ordr)(level, salary, amount, value)
regions(status, amount, id, value)
Task: Retrieve salary from requests with value above the SUM(value) of regions rows sharing the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12706 | train |
v2 | Schema:
accounts (alias: acct)(id, name, date, level)
categories(level, type, id, code)
Task: Find name from accounts where a matching record exists in categories with the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12707 | train |
v3 | Schema:
customers (alias: cust)(salary, value, date, code)
tasks(name, level, value, status)
Task: Find amount from customers where amount exceeds the maximum amount from tasks for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12708 | train |
v2 | Schema:
invoices (alias: inv)(amount, level, salary, type)
transactions(amount, type, status, date)
Task: Find id from invoices where a matching record exists in transactions with the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12709 | train |
v2 | Schema:
orders (alias: ord)(code, salary, id, level)
tasks(date, amount, code, name)
Task: Find amount from orders where a matching record exists in tasks with the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12710 | train |
v3 | Schema:
customers (alias: cust)(code, salary, level, date)
departments(type, code, date, level)
Task: Find salary from customers where amount exceeds the maximum salary from departments for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE amount > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12711 | train |
v2 | Schema:
staff (alias: empl)(name, salary, id, date)
accounts(type, name, id, amount)
Task: Retrieve amount from staff that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12712 | train |
v1 | Schema:
requests (alias: ordr)(level, name, code, type)
tasks(level, amount, code, value)
Task: Find amount from requests where id appears in tasks entries with matching level.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12713 | train |
v3 | Schema:
schedules (alias: schd)(status, level, salary, type)
departments(salary, code, type, amount)
Task: Retrieve id from schedules with value above the COUNT(amount) of departments rows sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12714 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, id, type)
staff(code, id, date, type)
Task: Retrieve salary from shipments that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12715 | train |
v2 | Schema:
requests (alias: ordr)(id, level, code, salary)
employees(salary, amount, status, code)
Task: Find code from requests where a matching record exists in employees with the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12716 | train |
v2 | Schema:
invoices (alias: inv)(level, date, code, amount)
schedules(name, status, code, value)
Task: Find id from invoices where a matching record exists in schedules with the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12717 | train |
v3 | Schema:
products (alias: prod)(level, date, name, value)
shipments(status, salary, date, id)
Task: Find amount from products where value exceeds the maximum salary from shipments for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12718 | train |
v1 | Schema:
transactions (alias: txn)(salary, date, id, name)
projects(salary, code, name, type)
Task: Find name from transactions where status appears in projects entries with matching level.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12719 | train |
v2 | Schema:
transactions (alias: txn)(value, id, code, level)
customers(amount, code, salary, status)
Task: Find id from transactions where a matching record exists in customers with the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12720 | train |
v3 | Schema:
customers (alias: cust)(name, salary, id, code)
shipments(date, type, id, status)
Task: Retrieve value from customers with value above the AVG(amount) of shipments rows sharing the same status.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12721 | train |
v3 | Schema:
orders (alias: ord)(level, id, name, salary)
customers(salary, value, status, type)
Task: Retrieve salary from orders with salary above the MIN(amount) of customers rows sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12722 | train |
v3 | Schema:
schedules (alias: schd)(amount, date, level, id)
invoices(value, type, name, id)
Task: Find salary from schedules where value exceeds the total amount from invoices for the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12723 | train |
v2 | Schema:
staff (alias: empl)(status, code, amount, level)
regions(level, salary, name, type)
Task: Find salary from staff where a matching record exists in regions with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12724 | train |
v2 | Schema:
staff (alias: empl)(date, amount, salary, code)
invoices(status, date, level, code)
Task: Retrieve value from staff that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12725 | train |
v2 | Schema:
accounts (alias: acct)(type, name, id, level)
requests(date, id, value, code)
Task: Find id from accounts where a matching record exists in requests with the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12726 | train |
v3 | Schema:
sales (alias: sale)(salary, code, type, id)
tasks(date, level, id, status)
Task: Find salary from sales where amount exceeds the average amount from tasks for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12727 | train |
v1 | Schema:
tasks (alias: tsk)(date, level, salary, value)
transactions(salary, id, amount, level)
Task: Find value from tasks where level appears in transactions entries with matching status.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12728 | train |
v3 | Schema:
regions (alias: rgn)(code, id, level, name)
schedules(value, status, date, type)
Task: Retrieve salary from regions with salary above the AVG(amount) of schedules rows sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12729 | train |
v3 | Schema:
projects (alias: prj)(value, level, salary, date)
shipments(name, date, value, status)
Task: Retrieve salary from projects with salary above the MAX(value) of shipments rows sharing the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12730 | train |
v3 | Schema:
customers (alias: cust)(amount, name, type, status)
products(date, code, salary, amount)
Task: Find code from customers where value exceeds the count of amount from products for the same code.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12731 | train |
v1 | Schema:
categories (alias: catg)(salary, name, status, type)
customers(value, amount, code, id)
Task: Select code from categories where id exists in customers for the same type.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12732 | train |
v2 | Schema:
branches (alias: brc)(id, type, amount, code)
regions(amount, name, salary, id)
Task: Retrieve value from branches that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12733 | train |
v3 | Schema:
employees (alias: emp)(salary, id, date, status)
shipments(amount, salary, name, id)
Task: Find value from employees where value exceeds the minimum value from shipments for the same level.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12734 | train |
v2 | Schema:
transactions (alias: txn)(type, level, name, value)
customers(status, date, level, id)
Task: Retrieve value from transactions that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12735 | train |
v3 | Schema:
projects (alias: prj)(value, type, code, status)
managers(level, id, code, salary)
Task: Find code from projects where amount exceeds the count of amount from managers for the same id.
SQL: | SELECT code FROM projects AS prj
WHERE amount > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12736 | train |
v3 | Schema:
branches (alias: brc)(name, level, code, value)
departments(name, type, date, status)
Task: Find amount from branches where value exceeds the minimum salary from departments for the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12737 | train |
v2 | Schema:
requests (alias: ordr)(status, salary, type, id)
branches(date, code, id, type)
Task: Find salary from requests where a matching record exists in branches with the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12738 | train |
v3 | Schema:
shipments (alias: shp)(status, amount, name, type)
schedules(status, date, amount, type)
Task: Find name from shipments where value exceeds the minimum value from schedules for the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12739 | train |
v3 | Schema:
items (alias: lne)(level, value, type, salary)
schedules(salary, value, date, type)
Task: Retrieve salary from items with amount above the SUM(salary) of schedules rows sharing the same level.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.level = lne.level
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12740 | train |
v2 | Schema:
sales (alias: sale)(value, name, amount, salary)
staff(level, date, value, code)
Task: Retrieve name from sales that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12741 | train |
v1 | Schema:
sales (alias: sale)(date, name, code, type)
departments(id, salary, amount, type)
Task: Find name from sales where level appears in departments entries with matching level.
SQL: | SELECT name FROM sales AS sale
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12742 | train |
v3 | Schema:
shipments (alias: shp)(code, name, date, type)
accounts(type, id, value, status)
Task: Retrieve name from shipments with salary above the SUM(amount) of accounts rows sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12743 | train |
v3 | Schema:
employees (alias: emp)(value, date, name, amount)
products(salary, amount, name, level)
Task: Retrieve id from employees with amount above the COUNT(amount) of products rows sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12744 | train |
v3 | Schema:
accounts (alias: acct)(value, code, amount, id)
categories(value, amount, name, salary)
Task: Retrieve salary from accounts with value above the COUNT(salary) of categories rows sharing the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12745 | train |
v2 | Schema:
shipments (alias: shp)(level, id, amount, value)
employees(salary, date, id, level)
Task: Retrieve name from shipments that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12746 | train |
v3 | Schema:
employees (alias: emp)(id, code, date, name)
schedules(name, code, id, salary)
Task: Find id from employees where amount exceeds the total value from schedules for the same id.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"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_12747 | train |
v2 | Schema:
requests (alias: ordr)(code, name, value, status)
branches(code, value, date, id)
Task: Find name from requests where a matching record exists in branches with the same level.
SQL: | SELECT name 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": "name",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12748 | train |
v3 | Schema:
tasks (alias: tsk)(status, type, code, salary)
regions(code, id, name, level)
Task: Find code from tasks where amount exceeds the count of salary from regions for the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12749 | train |
v1 | Schema:
items (alias: lne)(type, name, status, level)
branches(salary, name, value, code)
Task: Select name from items where id exists in branches for the same level.
SQL: | SELECT name FROM items AS lne
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12750 | train |
v3 | Schema:
tasks (alias: tsk)(code, type, name, status)
products(value, status, type, date)
Task: Find code from tasks where value exceeds the average amount from products for the same code.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_12751 | train |
v1 | Schema:
employees (alias: emp)(amount, salary, name, status)
transactions(amount, level, code, salary)
Task: Find id from employees where type appears in transactions entries with matching type.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12752 | train |
v2 | Schema:
schedules (alias: schd)(id, salary, amount, level)
branches(code, status, salary, id)
Task: Retrieve amount from schedules that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12753 | train |
v1 | Schema:
branches (alias: brc)(code, name, amount, value)
items(value, id, level, date)
Task: Select value from branches where id exists in items for the same type.
SQL: | SELECT value FROM branches AS brc
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12754 | train |
v3 | Schema:
regions (alias: rgn)(name, level, type, id)
customers(salary, value, type, status)
Task: Retrieve name from regions with amount above the MIN(amount) of customers rows sharing the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "name",
"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_12755 | train |
v3 | Schema:
managers (alias: mgr)(level, salary, id, code)
branches(level, name, salary, status)
Task: Find name from managers where value exceeds the total amount from branches for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12756 | train |
v2 | Schema:
shipments (alias: shp)(name, amount, salary, value)
departments(salary, status, type, code)
Task: Retrieve code from shipments that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12757 | train |
v3 | Schema:
categories (alias: catg)(code, amount, value, level)
items(date, amount, salary, name)
Task: Find amount from categories where value exceeds the minimum salary from items for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE value > (
SELECT MIN(salary) FROM items AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12758 | train |
v1 | Schema:
departments (alias: dept)(level, code, amount, name)
employees(name, date, status, id)
Task: Find code from departments where id appears in employees entries with matching status.
SQL: | SELECT code 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": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12759 | train |
v2 | Schema:
departments (alias: dept)(date, value, id, level)
transactions(type, level, name, date)
Task: Retrieve amount from departments that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12760 | train |
v3 | Schema:
products (alias: prod)(id, salary, name, date)
employees(name, level, status, date)
Task: Find salary from products where amount exceeds the minimum salary from employees for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.level = prod.level
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12761 | train |
v3 | Schema:
products (alias: prod)(amount, id, salary, date)
transactions(type, status, name, id)
Task: Find amount from products where salary exceeds the average amount from transactions for the same level.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12762 | train |
v3 | Schema:
items (alias: lne)(level, date, code, id)
branches(type, salary, value, level)
Task: Find amount from items where amount exceeds the average amount from branches for the same type.
SQL: | SELECT amount FROM items AS lne
WHERE amount > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.type = lne.type
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12763 | train |
v2 | Schema:
projects (alias: prj)(date, type, name, salary)
tasks(status, code, amount, salary)
Task: Find name from projects where a matching record exists in tasks with the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12764 | train |
v1 | Schema:
projects (alias: prj)(name, date, status, value)
categories(amount, code, level, type)
Task: Retrieve salary from projects whose id is found in categories rows where level matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_12765 | train |
v1 | Schema:
requests (alias: ordr)(type, id, salary, status)
transactions(status, salary, level, value)
Task: Retrieve name from requests whose code is found in transactions rows where status matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12766 | train |
v3 | Schema:
staff (alias: empl)(code, status, id, level)
customers(amount, status, code, id)
Task: Retrieve value from staff with value above the COUNT(value) of customers rows sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12767 | train |
v2 | Schema:
regions (alias: rgn)(amount, type, level, salary)
accounts(status, level, id, value)
Task: Find value from regions where a matching record exists in accounts with the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_12768 | train |
v2 | Schema:
staff (alias: empl)(amount, status, code, level)
sales(level, id, status, code)
Task: Retrieve amount from staff that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12769 | train |
v1 | Schema:
products (alias: prod)(date, value, amount, id)
categories(code, id, type, value)
Task: Find name from products where status appears in categories entries with matching type.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12770 | train |
v3 | Schema:
shipments (alias: shp)(date, level, name, value)
projects(date, status, level, id)
Task: Find amount from shipments where value exceeds the minimum value from projects for the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_12771 | train |
v3 | Schema:
categories (alias: catg)(status, value, amount, level)
products(amount, date, level, status)
Task: Find amount from categories where salary exceeds the minimum salary from products for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12772 | train |
v2 | Schema:
invoices (alias: inv)(id, salary, amount, value)
orders(status, amount, id, type)
Task: Find id from invoices where a matching record exists in orders with the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12773 | train |
v2 | Schema:
schedules (alias: schd)(value, type, level, date)
departments(name, value, amount, code)
Task: Retrieve amount from schedules that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12774 | train |
v3 | Schema:
branches (alias: brc)(name, amount, salary, value)
departments(code, amount, name, id)
Task: Find amount from branches where amount exceeds the count of salary from departments for the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE amount > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_12775 | train |
v2 | Schema:
schedules (alias: schd)(amount, type, status, salary)
products(date, salary, code, id)
Task: Find code from schedules where a matching record exists in products with the same code.
SQL: | SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12776 | train |
v1 | Schema:
accounts (alias: acct)(salary, code, id, status)
staff(status, code, id, type)
Task: Find id from accounts where code appears in staff entries with matching id.
SQL: | SELECT id FROM accounts AS acct
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12777 | train |
v1 | Schema:
requests (alias: ordr)(level, type, name, id)
customers(name, id, type, date)
Task: Retrieve amount from requests whose id is found in customers rows where id matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12778 | train |
v1 | Schema:
accounts (alias: acct)(code, name, status, level)
branches(code, value, name, amount)
Task: Find code from accounts where status appears in branches entries with matching level.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12779 | train |
v2 | Schema:
items (alias: lne)(code, salary, date, id)
shipments(code, date, salary, amount)
Task: Retrieve name from items that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12780 | train |
v2 | Schema:
staff (alias: empl)(level, date, type, name)
accounts(status, value, name, id)
Task: Retrieve code from staff that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12781 | train |
v1 | Schema:
invoices (alias: inv)(level, salary, date, type)
schedules(amount, type, id, status)
Task: Select code from invoices where type exists in schedules for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12782 | train |
v2 | Schema:
items (alias: lne)(level, id, code, value)
employees(amount, id, type, date)
Task: Retrieve code from items that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12783 | train |
v3 | Schema:
managers (alias: mgr)(level, value, amount, type)
schedules(value, date, status, amount)
Task: Retrieve amount from managers with amount above the MIN(amount) of schedules rows sharing the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12784 | train |
v3 | Schema:
sales (alias: sale)(date, amount, type, name)
branches(salary, level, code, value)
Task: Find id from sales where value exceeds the minimum salary from branches for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12785 | train |
v3 | Schema:
customers (alias: cust)(name, code, type, value)
shipments(value, status, name, salary)
Task: Retrieve code from customers with amount above the MAX(value) of shipments rows sharing the same level.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12786 | train |
v3 | Schema:
sales (alias: sale)(salary, amount, id, name)
requests(type, salary, name, amount)
Task: Retrieve code from sales with value above the SUM(value) of requests rows sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12787 | train |
v1 | Schema:
categories (alias: catg)(name, code, salary, level)
invoices(id, status, name, value)
Task: Select code from categories where status exists in invoices for the same type.
SQL: | SELECT code FROM categories AS catg
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12788 | train |
v2 | Schema:
items (alias: lne)(status, code, type, value)
schedules(amount, value, status, level)
Task: Retrieve id from items that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = lne.level
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12789 | train |
v2 | Schema:
orders (alias: ord)(id, date, name, amount)
employees(level, name, id, date)
Task: Retrieve code from orders that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12790 | train |
v3 | Schema:
requests (alias: ordr)(id, type, level, date)
accounts(code, value, type, date)
Task: Retrieve id from requests with salary above the AVG(value) of accounts rows sharing the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12791 | train |
v2 | Schema:
categories (alias: catg)(type, value, salary, date)
transactions(value, status, date, id)
Task: Retrieve id from categories that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_12792 | train |
v3 | Schema:
sales (alias: sale)(salary, status, level, value)
requests(value, level, salary, id)
Task: Find value from sales where salary exceeds the average salary from requests for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12793 | train |
v2 | Schema:
items (alias: lne)(salary, level, id, type)
categories(name, date, code, salary)
Task: Retrieve name from items that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = lne.code
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_12794 | train |
v1 | Schema:
requests (alias: ordr)(type, status, name, salary)
managers(type, status, value, level)
Task: Retrieve salary from requests whose code is found in managers rows where type matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_12795 | train |
v2 | Schema:
staff (alias: empl)(value, date, level, amount)
categories(id, salary, level, code)
Task: Find salary from staff where a matching record exists in categories with the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_12796 | train |
v2 | Schema:
transactions (alias: txn)(value, id, date, level)
customers(code, level, amount, salary)
Task: Find id from transactions where a matching record exists in customers with the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12797 | train |
v1 | Schema:
customers (alias: cust)(value, code, name, date)
sales(value, level, id, salary)
Task: Find id from customers where type appears in sales entries with matching status.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12798 | train |
v3 | Schema:
departments (alias: dept)(amount, value, date, code)
projects(id, name, amount, status)
Task: Find code from departments where value exceeds the minimum amount from projects for the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_12799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.