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:
items (alias: lne)(id, level, amount, name)
departments(id, value, level, code)
Task: Retrieve name from items with salary above the AVG(value) of departments rows sharing the same status.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13600 | train |
v3 | Schema:
invoices (alias: inv)(id, type, code, value)
regions(name, amount, type, date)
Task: Retrieve id from invoices with salary above the AVG(salary) of regions rows sharing the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13601 | train |
v3 | Schema:
schedules (alias: schd)(code, salary, status, id)
regions(name, salary, type, id)
Task: Retrieve id from schedules with amount above the SUM(salary) of regions rows sharing the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13602 | train |
v1 | Schema:
products (alias: prod)(salary, code, date, id)
sales(status, value, level, code)
Task: Retrieve code from products whose code is found in sales rows where type matches the outer record.
SQL: | SELECT code FROM products AS prod
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = prod.type
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13603 | train |
v2 | Schema:
accounts (alias: acct)(value, name, code, amount)
invoices(date, value, type, amount)
Task: Find salary from accounts where a matching record exists in invoices with the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13604 | train |
v1 | Schema:
invoices (alias: inv)(value, type, date, level)
requests(code, name, level, salary)
Task: Find value from invoices where code appears in requests entries with matching type.
SQL: | SELECT value FROM invoices AS inv
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13605 | train |
v2 | Schema:
sales (alias: sale)(id, type, amount, salary)
shipments(date, name, status, type)
Task: Find id from sales where a matching record exists in shipments with the same status.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13606 | train |
v1 | Schema:
staff (alias: empl)(level, amount, value, id)
invoices(level, value, date, salary)
Task: Find amount from staff where id appears in invoices entries with matching status.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13607 | train |
v2 | Schema:
accounts (alias: acct)(salary, date, value, type)
projects(name, status, id, type)
Task: Find amount from accounts where a matching record exists in projects with the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13608 | train |
v1 | Schema:
shipments (alias: shp)(id, value, date, type)
requests(code, id, type, amount)
Task: Find salary from shipments where status appears in requests entries with matching code.
SQL: | SELECT salary FROM shipments AS shp
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13609 | train |
v3 | Schema:
transactions (alias: txn)(type, date, status, level)
sales(name, code, value, amount)
Task: Find code from transactions where value exceeds the total value from sales for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13610 | train |
v2 | Schema:
orders (alias: ord)(date, type, salary, id)
sales(date, level, type, salary)
Task: Find name from orders where a matching record exists in sales with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13611 | train |
v2 | Schema:
staff (alias: empl)(amount, level, type, name)
accounts(status, type, amount, date)
Task: Retrieve code from staff that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13612 | train |
v3 | Schema:
sales (alias: sale)(date, value, status, type)
products(id, code, date, amount)
Task: Find id from sales where salary exceeds the count of value from products for the same id.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13613 | train |
v3 | Schema:
customers (alias: cust)(amount, value, level, code)
shipments(salary, type, date, status)
Task: Find value from customers where amount exceeds the minimum amount from shipments for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13614 | train |
v3 | Schema:
departments (alias: dept)(name, type, date, salary)
shipments(id, salary, name, type)
Task: Find salary from departments where amount exceeds the average value from shipments for the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT AVG(value) FROM shipments AS shp
WHERE shp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13615 | train |
v3 | Schema:
staff (alias: empl)(value, code, level, type)
orders(date, value, level, code)
Task: Retrieve id from staff with amount above the COUNT(amount) of orders rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT COUNT(amount) 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": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13616 | train |
v3 | Schema:
categories (alias: catg)(level, salary, amount, name)
managers(salary, amount, status, type)
Task: Find code from categories where value exceeds the total amount from managers for the same id.
SQL: | SELECT code FROM categories AS catg
WHERE value > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13617 | train |
v2 | Schema:
staff (alias: empl)(id, salary, amount, level)
tasks(type, code, salary, amount)
Task: Find value from staff where a matching record exists in tasks with the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13618 | train |
v3 | Schema:
orders (alias: ord)(amount, level, value, type)
customers(status, code, date, id)
Task: Retrieve salary from orders with salary above the COUNT(salary) of customers rows sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(salary) 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": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13619 | train |
v3 | Schema:
items (alias: lne)(level, value, amount, salary)
customers(code, amount, type, name)
Task: Find id from items where salary exceeds the total salary from customers for the same level.
SQL: | SELECT id FROM items AS lne
WHERE salary > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13620 | train |
v3 | Schema:
products (alias: prod)(id, type, code, amount)
schedules(salary, type, amount, status)
Task: Retrieve id from products with value above the MIN(value) of schedules rows sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.level = prod.level
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13621 | train |
v3 | Schema:
products (alias: prod)(type, id, level, value)
accounts(level, id, value, amount)
Task: Find amount from products where value exceeds the maximum salary from accounts for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.id = prod.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"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_13622 | train |
v2 | Schema:
categories (alias: catg)(date, name, status, amount)
schedules(type, code, status, value)
Task: Find name from categories where a matching record exists in schedules with the same code.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13623 | train |
v1 | Schema:
projects (alias: prj)(amount, level, value, salary)
employees(code, date, name, id)
Task: Select value from projects where level exists in employees for the same status.
SQL: | SELECT value FROM projects AS prj
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13624 | train |
v3 | Schema:
schedules (alias: schd)(name, level, date, type)
customers(id, date, code, amount)
Task: Find salary from schedules where value exceeds the count of salary from customers for the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13625 | train |
v2 | Schema:
regions (alias: rgn)(amount, date, level, value)
branches(type, level, salary, value)
Task: Find id from regions where a matching record exists in branches with the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13626 | train |
v3 | Schema:
orders (alias: ord)(status, value, level, type)
tasks(id, level, date, status)
Task: Find amount from orders where salary exceeds the count of salary from tasks for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13627 | train |
v2 | Schema:
sales (alias: sale)(type, salary, name, amount)
tasks(name, level, type, date)
Task: Find amount from sales where a matching record exists in tasks with the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13628 | train |
v2 | Schema:
invoices (alias: inv)(salary, level, status, type)
products(code, id, date, status)
Task: Retrieve value from invoices that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13629 | train |
v1 | Schema:
invoices (alias: inv)(date, value, type, code)
accounts(name, salary, date, level)
Task: Select value from invoices where level exists in accounts for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13630 | train |
v1 | Schema:
shipments (alias: shp)(code, date, name, salary)
staff(status, code, value, id)
Task: Select id from shipments where id exists in staff for the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13631 | train |
v2 | Schema:
regions (alias: rgn)(value, status, code, id)
items(salary, status, date, value)
Task: Find value from regions where a matching record exists in items with the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13632 | train |
v2 | Schema:
schedules (alias: schd)(code, value, salary, id)
regions(amount, type, name, level)
Task: Find name from schedules where a matching record exists in regions with the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13633 | train |
v3 | Schema:
accounts (alias: acct)(amount, value, date, status)
branches(name, id, status, amount)
Task: Retrieve amount from accounts with value above the MAX(amount) of branches rows sharing the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT MAX(amount) FROM branches AS brc
WHERE brc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13634 | train |
v3 | Schema:
staff (alias: empl)(date, level, code, value)
regions(status, id, name, value)
Task: Retrieve name from staff with amount above the SUM(value) of regions rows sharing the same type.
SQL: | SELECT name FROM staff AS empl
WHERE amount > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13635 | train |
v2 | Schema:
requests (alias: ordr)(salary, name, amount, date)
transactions(code, amount, value, date)
Task: Find salary from requests where a matching record exists in transactions with the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13636 | train |
v2 | Schema:
projects (alias: prj)(type, name, id, code)
items(status, code, amount, salary)
Task: Retrieve id from projects that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13637 | train |
v3 | Schema:
customers (alias: cust)(code, name, value, id)
regions(type, salary, id, level)
Task: Retrieve amount from customers with amount above the AVG(value) of regions rows sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13638 | train |
v2 | Schema:
branches (alias: brc)(code, amount, level, date)
customers(status, code, type, date)
Task: Retrieve id from branches that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13639 | train |
v1 | Schema:
customers (alias: cust)(salary, status, name, value)
categories(value, id, name, amount)
Task: Retrieve amount from customers whose type is found in categories rows where id matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13640 | train |
v3 | Schema:
customers (alias: cust)(name, level, code, amount)
items(level, amount, date, value)
Task: Find amount from customers where salary exceeds the maximum value from items for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13641 | train |
v1 | Schema:
items (alias: lne)(status, code, value, level)
employees(salary, value, status, code)
Task: Select id from items where type exists in employees for the same level.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13642 | train |
v3 | Schema:
orders (alias: ord)(id, type, status, amount)
regions(level, amount, value, type)
Task: Find salary from orders where salary exceeds the count of amount from regions for the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13643 | train |
v2 | Schema:
invoices (alias: inv)(level, date, id, amount)
schedules(name, salary, status, id)
Task: Find amount from invoices where a matching record exists in schedules with the same status.
SQL: | SELECT amount 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": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13644 | train |
v3 | Schema:
transactions (alias: txn)(amount, status, name, level)
departments(id, salary, status, name)
Task: Find code from transactions where value exceeds the average value from departments for the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13645 | train |
v1 | Schema:
employees (alias: emp)(amount, date, status, salary)
requests(type, status, name, salary)
Task: Find code from employees where code appears in requests entries with matching level.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13646 | train |
v1 | Schema:
schedules (alias: schd)(code, value, level, status)
orders(name, code, value, id)
Task: Find id from schedules where id appears in orders entries with matching id.
SQL: | SELECT id FROM schedules AS schd
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13647 | train |
v1 | Schema:
orders (alias: ord)(name, type, level, amount)
tasks(id, value, salary, status)
Task: Retrieve value from orders whose type is found in tasks rows where id matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13648 | train |
v1 | Schema:
customers (alias: cust)(name, salary, type, level)
sales(salary, code, value, type)
Task: Select salary from customers where type exists in sales for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13649 | train |
v2 | Schema:
employees (alias: emp)(value, level, id, status)
shipments(code, id, status, amount)
Task: Find amount from employees where a matching record exists in shipments with the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13650 | train |
v2 | Schema:
branches (alias: brc)(value, salary, name, type)
categories(date, name, status, amount)
Task: Retrieve id from branches that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13651 | train |
v2 | Schema:
schedules (alias: schd)(date, name, salary, id)
categories(amount, type, level, salary)
Task: Retrieve code from schedules that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13652 | train |
v1 | Schema:
shipments (alias: shp)(status, salary, id, amount)
employees(type, value, salary, level)
Task: Retrieve value from shipments whose status is found in employees rows where type matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13653 | train |
v3 | Schema:
managers (alias: mgr)(type, value, name, code)
categories(status, level, type, code)
Task: Retrieve salary from managers with value above the SUM(amount) of categories rows sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) 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": "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_13654 | train |
v3 | Schema:
branches (alias: brc)(salary, name, level, amount)
items(status, code, level, value)
Task: Retrieve salary from branches with value above the MAX(value) of items rows sharing the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13655 | train |
v3 | Schema:
accounts (alias: acct)(name, type, value, date)
regions(name, value, status, level)
Task: Retrieve code from accounts with amount above the COUNT(salary) of regions rows sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13656 | train |
v3 | Schema:
accounts (alias: acct)(name, amount, level, status)
shipments(salary, code, id, amount)
Task: Find value from accounts where salary exceeds the maximum value from shipments for the same status.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13657 | train |
v2 | Schema:
categories (alias: catg)(value, code, status, amount)
items(code, date, status, type)
Task: Find amount from categories where a matching record exists in items with the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13658 | train |
v2 | Schema:
items (alias: lne)(value, code, name, status)
orders(status, salary, id, date)
Task: Retrieve value from items that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13659 | train |
v2 | Schema:
employees (alias: emp)(value, type, date, code)
products(level, amount, id, date)
Task: Find name from employees where a matching record exists in products with the same status.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13660 | train |
v1 | Schema:
managers (alias: mgr)(type, id, value, status)
items(name, id, value, date)
Task: Retrieve value from managers whose type is found in items rows where code matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13661 | train |
v3 | Schema:
orders (alias: ord)(amount, value, type, code)
requests(type, id, value, salary)
Task: Retrieve amount from orders with value above the MAX(amount) of requests rows sharing the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13662 | train |
v3 | Schema:
accounts (alias: acct)(status, type, name, level)
invoices(amount, date, type, status)
Task: Retrieve amount from accounts with amount above the MAX(amount) of invoices rows sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13663 | train |
v2 | Schema:
requests (alias: ordr)(id, amount, salary, value)
customers(id, type, date, level)
Task: Retrieve code from requests that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13664 | train |
v2 | Schema:
requests (alias: ordr)(salary, level, status, id)
regions(salary, date, value, name)
Task: Find amount from requests where a matching record exists in regions with the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13665 | train |
v2 | Schema:
staff (alias: empl)(value, id, name, status)
sales(amount, value, name, salary)
Task: Find value from staff where a matching record exists in sales with the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13666 | train |
v1 | Schema:
employees (alias: emp)(status, salary, id, date)
transactions(type, name, status, code)
Task: Find value from employees where status appears in transactions entries with matching status.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13667 | train |
v2 | Schema:
departments (alias: dept)(value, date, status, name)
employees(id, value, type, name)
Task: Retrieve salary from departments that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13668 | train |
v2 | Schema:
accounts (alias: acct)(name, level, amount, type)
managers(type, amount, salary, id)
Task: Find amount from accounts where a matching record exists in managers with the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13669 | train |
v3 | Schema:
tasks (alias: tsk)(id, amount, value, date)
branches(salary, type, amount, name)
Task: Find value from tasks where value exceeds the average salary from branches for the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13670 | train |
v3 | Schema:
transactions (alias: txn)(status, code, type, salary)
shipments(id, date, amount, status)
Task: Retrieve code from transactions with value above the SUM(value) of shipments rows sharing the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13671 | train |
v3 | Schema:
items (alias: lne)(name, status, id, value)
departments(date, level, id, type)
Task: Find salary from items where amount exceeds the total amount from departments for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13672 | train |
v3 | Schema:
projects (alias: prj)(id, salary, type, level)
regions(id, code, name, amount)
Task: Find name from projects where value exceeds the average salary from regions for the same status.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13673 | train |
v3 | Schema:
employees (alias: emp)(value, id, amount, level)
categories(date, id, level, type)
Task: Find code from employees where salary exceeds the maximum salary from categories for the same level.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13674 | train |
v1 | Schema:
tasks (alias: tsk)(code, status, level, value)
categories(value, name, id, code)
Task: Find name from tasks where id appears in categories entries with matching status.
SQL: | SELECT name FROM tasks AS tsk
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13675 | train |
v1 | Schema:
regions (alias: rgn)(salary, id, code, date)
branches(status, level, id, date)
Task: Retrieve amount from regions whose id is found in branches rows where level matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13676 | train |
v1 | Schema:
categories (alias: catg)(amount, salary, type, status)
staff(status, salary, name, date)
Task: Retrieve code from categories whose code is found in staff rows where status matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13677 | train |
v3 | Schema:
accounts (alias: acct)(code, level, name, amount)
products(name, code, date, id)
Task: Find amount from accounts where value exceeds the count of salary from products for the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "amount",
"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_13678 | train |
v1 | Schema:
branches (alias: brc)(type, value, status, salary)
requests(status, id, salary, code)
Task: Select salary from branches where code exists in requests for the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13679 | train |
v2 | Schema:
tasks (alias: tsk)(date, status, value, level)
categories(level, date, salary, status)
Task: Find salary from tasks where a matching record exists in categories with the same status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13680 | train |
v3 | Schema:
customers (alias: cust)(salary, name, value, amount)
invoices(value, salary, code, amount)
Task: Find name from customers where amount exceeds the average amount from invoices for the same level.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13681 | train |
v2 | Schema:
customers (alias: cust)(id, code, level, type)
employees(value, name, level, salary)
Task: Find code from customers where a matching record exists in employees with the same status.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13682 | train |
v2 | Schema:
regions (alias: rgn)(value, code, amount, date)
tasks(date, level, name, amount)
Task: Retrieve id from regions that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13683 | train |
v2 | Schema:
requests (alias: ordr)(type, name, value, level)
categories(type, value, name, amount)
Task: Retrieve name from requests that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13684 | train |
v3 | Schema:
staff (alias: empl)(level, amount, id, code)
customers(value, date, type, level)
Task: Find id from staff where value exceeds the average salary from customers for the same id.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13685 | train |
v2 | Schema:
invoices (alias: inv)(level, amount, code, status)
managers(code, value, amount, date)
Task: Find amount from invoices where a matching record exists in managers with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13686 | train |
v1 | Schema:
customers (alias: cust)(level, value, id, salary)
projects(level, value, salary, name)
Task: Retrieve amount from customers whose type is found in projects rows where status matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13687 | train |
v3 | Schema:
categories (alias: catg)(name, value, amount, type)
transactions(salary, date, level, amount)
Task: Find salary from categories where amount exceeds the average amount from transactions for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13688 | train |
v2 | Schema:
orders (alias: ord)(salary, level, code, type)
products(salary, date, level, code)
Task: Retrieve code from orders that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13689 | train |
v1 | Schema:
invoices (alias: inv)(id, level, salary, date)
accounts(code, level, id, status)
Task: Select id from invoices where code exists in accounts for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13690 | train |
v2 | Schema:
shipments (alias: shp)(date, amount, code, id)
orders(id, salary, amount, value)
Task: Retrieve value from shipments that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13691 | train |
v3 | Schema:
categories (alias: catg)(id, status, value, type)
transactions(name, level, date, code)
Task: Retrieve salary from categories with salary above the COUNT(amount) of transactions rows sharing the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13692 | train |
v1 | Schema:
tasks (alias: tsk)(code, salary, value, amount)
managers(type, id, salary, level)
Task: Select amount from tasks where type exists in managers for the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13693 | train |
v1 | Schema:
accounts (alias: acct)(type, level, name, salary)
departments(code, name, level, salary)
Task: Retrieve salary from accounts whose id is found in departments rows where code matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13694 | train |
v3 | Schema:
schedules (alias: schd)(amount, date, id, code)
customers(level, type, date, amount)
Task: Find id from schedules where value exceeds the maximum salary from customers for the same level.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13695 | train |
v1 | Schema:
shipments (alias: shp)(level, id, code, value)
customers(name, level, id, status)
Task: Retrieve amount from shipments whose status is found in customers rows where code matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13696 | train |
v2 | Schema:
invoices (alias: inv)(value, code, salary, id)
customers(date, value, status, type)
Task: Find id from invoices where a matching record exists in customers with the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13697 | train |
v3 | Schema:
requests (alias: ordr)(name, id, status, type)
transactions(id, level, value, salary)
Task: Retrieve code from requests with salary above the MAX(salary) of transactions rows sharing the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE salary > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13698 | train |
v1 | Schema:
employees (alias: emp)(salary, code, value, id)
schedules(level, id, salary, date)
Task: Find name from employees where level appears in schedules entries with matching code.
SQL: | SELECT name FROM employees AS emp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.