variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
managers (alias: mgr)(type, id, status, date)
employees(amount, code, salary, type)
Task: Select name from managers where type exists in employees for the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13000 | train |
v2 | Schema:
accounts (alias: acct)(salary, value, id, type)
transactions(name, date, status, salary)
Task: Find salary from accounts where a matching record exists in transactions with the same code.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13001 | train |
v2 | Schema:
categories (alias: catg)(name, code, amount, id)
items(id, status, level, date)
Task: Find value from categories where a matching record exists in items with the same level.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13002 | train |
v1 | Schema:
sales (alias: sale)(value, status, level, date)
employees(name, status, type, date)
Task: Find name from sales where type appears in employees entries with matching status.
SQL: | SELECT name FROM sales AS sale
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13003 | train |
v2 | Schema:
schedules (alias: schd)(value, id, amount, status)
shipments(date, value, id, status)
Task: Retrieve name from schedules that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13004 | train |
v3 | Schema:
staff (alias: empl)(type, date, id, code)
transactions(type, salary, name, amount)
Task: Find value from staff where amount exceeds the average amount from transactions for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13005 | train |
v2 | Schema:
departments (alias: dept)(value, date, amount, id)
managers(salary, id, value, name)
Task: Find value from departments where a matching record exists in managers with the same status.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13006 | train |
v1 | Schema:
regions (alias: rgn)(status, date, amount, value)
accounts(value, type, date, status)
Task: Select id from regions where level exists in accounts for the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13007 | train |
v1 | Schema:
accounts (alias: acct)(amount, name, status, date)
invoices(type, code, status, id)
Task: Select code from accounts where id exists in invoices for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13008 | train |
v2 | Schema:
staff (alias: empl)(type, status, id, salary)
departments(value, amount, type, code)
Task: Retrieve amount from staff that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13009 | train |
v3 | Schema:
projects (alias: prj)(level, code, amount, value)
managers(status, code, type, name)
Task: Retrieve value from projects with value above the COUNT(value) of managers rows sharing the same type.
SQL: | SELECT value FROM projects AS prj
WHERE value > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13010 | train |
v2 | Schema:
projects (alias: prj)(name, code, amount, status)
requests(type, level, date, salary)
Task: Retrieve id from projects that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13011 | train |
v1 | Schema:
shipments (alias: shp)(amount, status, type, salary)
customers(value, status, date, name)
Task: Select value from shipments where level exists in customers for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13012 | train |
v1 | Schema:
customers (alias: cust)(level, id, type, code)
schedules(value, id, level, status)
Task: Find salary from customers where id appears in schedules entries with matching level.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13013 | train |
v2 | Schema:
customers (alias: cust)(id, code, level, salary)
orders(value, status, amount, date)
Task: Find id from customers where a matching record exists in orders with the same type.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13014 | train |
v1 | Schema:
projects (alias: prj)(level, amount, salary, date)
shipments(status, id, code, amount)
Task: Select amount from projects where type exists in shipments for the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13015 | train |
v2 | Schema:
employees (alias: emp)(level, type, code, salary)
transactions(code, date, id, amount)
Task: Retrieve code from employees that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13016 | train |
v1 | Schema:
managers (alias: mgr)(type, value, name, code)
accounts(date, value, type, name)
Task: Select name from managers where type exists in accounts for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13017 | train |
v2 | Schema:
regions (alias: rgn)(name, amount, type, salary)
requests(code, level, status, salary)
Task: Find salary from regions where a matching record exists in requests with the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13018 | train |
v2 | Schema:
departments (alias: dept)(salary, date, type, status)
transactions(amount, code, level, date)
Task: Find amount from departments where a matching record exists in transactions with the same code.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13019 | train |
v3 | Schema:
products (alias: prod)(date, salary, code, id)
accounts(amount, salary, id, value)
Task: Retrieve code from products with value above the COUNT(salary) of accounts rows sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = prod.type
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13020 | train |
v3 | Schema:
regions (alias: rgn)(value, status, id, name)
requests(type, value, status, name)
Task: Retrieve code from regions with value above the MIN(salary) of requests rows sharing the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13021 | train |
v3 | Schema:
items (alias: lne)(code, id, status, date)
sales(id, name, value, status)
Task: Retrieve salary from items with value above the AVG(value) of sales rows sharing the same type.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.type = lne.type
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13022 | train |
v2 | Schema:
items (alias: lne)(value, salary, amount, id)
invoices(status, amount, type, id)
Task: Retrieve salary from items that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = lne.type
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13023 | train |
v2 | Schema:
sales (alias: sale)(amount, code, status, date)
projects(date, type, amount, id)
Task: Find amount from sales where a matching record exists in projects with the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13024 | train |
v1 | Schema:
shipments (alias: shp)(level, name, date, amount)
requests(amount, id, date, level)
Task: Select code from shipments where code exists in requests for the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13025 | train |
v3 | Schema:
managers (alias: mgr)(code, name, date, type)
regions(name, code, id, value)
Task: Find name from managers where amount exceeds the average salary from regions for the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13026 | train |
v1 | Schema:
categories (alias: catg)(date, type, id, code)
products(amount, value, salary, level)
Task: Retrieve salary from categories whose id is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13027 | train |
v1 | Schema:
transactions (alias: txn)(code, id, amount, status)
managers(date, type, salary, status)
Task: Retrieve name from transactions whose level is found in managers rows where id matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13028 | train |
v2 | Schema:
categories (alias: catg)(amount, id, date, level)
products(status, date, salary, name)
Task: Retrieve id from categories that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13029 | train |
v2 | Schema:
projects (alias: prj)(salary, type, name, level)
items(value, date, salary, level)
Task: Find salary from projects where a matching record exists in items with the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13030 | train |
v1 | Schema:
sales (alias: sale)(status, id, code, value)
categories(status, value, id, level)
Task: Find code from sales where id appears in categories entries with matching type.
SQL: | SELECT code FROM sales AS sale
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13031 | train |
v3 | Schema:
branches (alias: brc)(date, amount, salary, value)
invoices(level, type, id, status)
Task: Retrieve value from branches with value above the SUM(value) of invoices rows sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13032 | train |
v2 | Schema:
categories (alias: catg)(id, value, salary, amount)
transactions(status, amount, type, value)
Task: Find value from categories where a matching record exists in transactions with the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13033 | train |
v1 | Schema:
branches (alias: brc)(type, code, status, salary)
sales(name, salary, code, amount)
Task: Retrieve id from branches whose type is found in sales rows where type matches the outer record.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13034 | train |
v1 | Schema:
customers (alias: cust)(level, code, type, value)
schedules(date, type, status, id)
Task: Select value from customers where id exists in schedules for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13035 | train |
v1 | Schema:
invoices (alias: inv)(amount, type, date, status)
staff(salary, amount, code, value)
Task: Retrieve amount from invoices whose status is found in staff rows where code matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13036 | train |
v3 | Schema:
items (alias: lne)(salary, id, name, code)
projects(value, type, name, code)
Task: Find salary from items where salary exceeds the count of salary from projects for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM projects AS prj
WHERE prj.status = lne.status
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13037 | train |
v1 | Schema:
schedules (alias: schd)(name, date, level, type)
items(amount, date, status, level)
Task: Retrieve code from schedules whose level is found in items rows where type matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13038 | train |
v3 | Schema:
regions (alias: rgn)(value, id, code, level)
orders(id, code, type, amount)
Task: Retrieve code from regions with salary above the AVG(value) of orders rows sharing the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13039 | train |
v1 | Schema:
projects (alias: prj)(status, amount, date, id)
employees(id, salary, date, name)
Task: Select name from projects where type exists in employees for the same code.
SQL: | SELECT name FROM projects AS prj
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13040 | train |
v1 | Schema:
projects (alias: prj)(type, level, status, date)
employees(status, salary, name, type)
Task: Select id from projects where code exists in employees for the same code.
SQL: | SELECT id FROM projects AS prj
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13041 | train |
v3 | Schema:
branches (alias: brc)(name, id, date, amount)
products(level, amount, type, value)
Task: Retrieve name from branches with value above the SUM(salary) of products rows sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE value > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13042 | train |
v2 | Schema:
invoices (alias: inv)(value, date, salary, amount)
categories(id, value, name, type)
Task: Retrieve amount from invoices that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13043 | train |
v2 | Schema:
accounts (alias: acct)(type, status, salary, id)
tasks(value, status, id, level)
Task: Find code from accounts where a matching record exists in tasks with the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13044 | train |
v3 | Schema:
transactions (alias: txn)(id, date, status, level)
projects(status, value, name, amount)
Task: Retrieve id from transactions with amount above the COUNT(amount) of projects rows sharing the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE amount > (
SELECT COUNT(amount) FROM projects AS prj
WHERE prj.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13045 | train |
v1 | Schema:
orders (alias: ord)(id, salary, name, date)
staff(salary, amount, date, status)
Task: Retrieve salary from orders whose status is found in staff rows where level matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13046 | train |
v2 | Schema:
invoices (alias: inv)(date, type, amount, status)
categories(date, name, value, code)
Task: Find code from invoices where a matching record exists in categories with the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13047 | train |
v1 | Schema:
items (alias: lne)(status, id, amount, date)
schedules(code, date, amount, salary)
Task: Find salary from items where code appears in schedules entries with matching status.
SQL: | SELECT salary FROM items AS lne
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13048 | train |
v2 | Schema:
staff (alias: empl)(value, status, level, id)
accounts(type, status, level, id)
Task: Retrieve id from staff that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13049 | train |
v2 | Schema:
transactions (alias: txn)(type, amount, status, name)
staff(type, name, status, level)
Task: Find amount from transactions where a matching record exists in staff with the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13050 | train |
v1 | Schema:
tasks (alias: tsk)(date, salary, type, value)
accounts(type, date, code, value)
Task: Find code from tasks where id appears in accounts entries with matching type.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13051 | train |
v3 | Schema:
branches (alias: brc)(value, status, date, code)
regions(id, salary, status, date)
Task: Find salary from branches where salary exceeds the minimum value from regions for the same type.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13052 | train |
v2 | Schema:
schedules (alias: schd)(salary, level, amount, value)
products(name, code, id, level)
Task: Find salary from schedules where a matching record exists in products with the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13053 | train |
v1 | Schema:
schedules (alias: schd)(type, id, status, level)
staff(id, code, status, name)
Task: Select code from schedules where status exists in staff for the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13054 | train |
v1 | Schema:
schedules (alias: schd)(level, amount, type, date)
branches(status, date, amount, salary)
Task: Select value from schedules where level exists in branches for the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13055 | train |
v3 | Schema:
sales (alias: sale)(salary, date, status, code)
products(code, name, amount, type)
Task: Retrieve salary from sales with amount above the COUNT(salary) of products rows sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13056 | train |
v3 | Schema:
employees (alias: emp)(salary, level, id, value)
regions(name, type, date, value)
Task: Find salary from employees where salary exceeds the count of amount from regions for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT COUNT(amount) FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13057 | train |
v1 | Schema:
employees (alias: emp)(type, status, name, id)
products(date, type, name, amount)
Task: Select name from employees where type exists in products for the same type.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13058 | train |
v1 | Schema:
orders (alias: ord)(code, value, name, salary)
requests(salary, level, id, name)
Task: Select value from orders where id exists in requests for the same status.
SQL: | SELECT value FROM orders AS ord
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13059 | train |
v3 | Schema:
schedules (alias: schd)(value, id, date, type)
managers(status, name, id, amount)
Task: Retrieve value from schedules with value above the MIN(amount) of managers rows sharing the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT MIN(amount) FROM managers AS mgr
WHERE mgr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13060 | train |
v1 | Schema:
requests (alias: ordr)(level, code, salary, date)
invoices(date, status, level, salary)
Task: Retrieve name from requests whose code is found in invoices rows where code matches the outer record.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13061 | train |
v1 | Schema:
transactions (alias: txn)(level, date, salary, status)
regions(code, status, level, id)
Task: Find name from transactions where type appears in regions entries with matching id.
SQL: | SELECT name FROM transactions AS txn
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13062 | train |
v3 | Schema:
requests (alias: ordr)(code, amount, type, level)
sales(id, date, value, type)
Task: Retrieve code from requests with value above the AVG(value) of sales rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13063 | train |
v3 | Schema:
orders (alias: ord)(amount, code, date, level)
products(date, amount, code, id)
Task: Find value from orders where salary exceeds the count of value from products for the same type.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM products AS prod
WHERE prod.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13064 | train |
v2 | Schema:
items (alias: lne)(id, value, code, date)
schedules(id, code, salary, name)
Task: Find code from items where a matching record exists in schedules with the same level.
SQL: | SELECT code 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": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13065 | train |
v2 | Schema:
shipments (alias: shp)(code, status, type, salary)
sales(salary, name, status, code)
Task: Find name from shipments where a matching record exists in sales with the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13066 | train |
v1 | Schema:
employees (alias: emp)(value, salary, name, id)
sales(type, code, name, salary)
Task: Retrieve amount from employees whose code is found in sales rows where status matches the outer record.
SQL: | SELECT amount FROM employees AS emp
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13067 | train |
v2 | Schema:
schedules (alias: schd)(id, level, value, type)
items(type, code, id, date)
Task: Retrieve value from schedules that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13068 | train |
v3 | Schema:
schedules (alias: schd)(level, amount, date, value)
accounts(id, type, amount, level)
Task: Retrieve code from schedules with amount above the COUNT(salary) of accounts rows sharing the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13069 | train |
v3 | Schema:
tasks (alias: tsk)(value, level, amount, date)
invoices(amount, name, level, code)
Task: Retrieve salary from tasks with value above the SUM(salary) of invoices rows sharing the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13070 | train |
v1 | Schema:
orders (alias: ord)(amount, id, status, code)
departments(id, amount, name, type)
Task: Find name from orders where type appears in departments entries with matching status.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13071 | train |
v2 | Schema:
staff (alias: empl)(code, name, level, status)
tasks(code, amount, date, type)
Task: Find value from staff where a matching record exists in tasks with the same code.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13072 | train |
v3 | Schema:
managers (alias: mgr)(id, value, date, name)
customers(code, amount, type, salary)
Task: Retrieve value from managers with amount above the SUM(value) of customers rows sharing the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE amount > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13073 | train |
v2 | Schema:
schedules (alias: schd)(date, salary, type, id)
shipments(level, value, name, id)
Task: Find salary from schedules where a matching record exists in shipments with the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13074 | train |
v3 | Schema:
employees (alias: emp)(status, level, amount, value)
managers(date, level, id, type)
Task: Retrieve salary from employees with salary above the COUNT(value) of managers rows sharing the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13075 | train |
v1 | Schema:
customers (alias: cust)(level, code, id, type)
sales(type, level, name, status)
Task: Find code from customers where code appears in sales entries with matching status.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13076 | train |
v3 | Schema:
schedules (alias: schd)(level, salary, amount, name)
departments(salary, name, amount, type)
Task: Find salary from schedules where value exceeds the count of salary from departments for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13077 | train |
v3 | Schema:
staff (alias: empl)(id, type, value, amount)
transactions(name, value, level, salary)
Task: Retrieve id from staff with value above the MIN(value) of transactions rows sharing the same type.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13078 | train |
v3 | Schema:
tasks (alias: tsk)(id, salary, status, type)
departments(level, date, code, amount)
Task: Find code from tasks where value exceeds the minimum salary from departments for the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13079 | train |
v1 | Schema:
accounts (alias: acct)(code, level, amount, id)
products(status, amount, level, id)
Task: Select code from accounts where level exists in products for the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13080 | train |
v1 | Schema:
orders (alias: ord)(date, value, amount, name)
tasks(level, value, status, date)
Task: Find id from orders where type appears in tasks entries with matching status.
SQL: | SELECT id FROM orders AS ord
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13081 | train |
v1 | Schema:
transactions (alias: txn)(type, name, id, salary)
branches(name, level, value, status)
Task: Find code from transactions where code appears in branches entries with matching code.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13082 | train |
v3 | Schema:
accounts (alias: acct)(id, salary, level, type)
categories(id, value, code, name)
Task: Find value from accounts where salary exceeds the total value from categories for the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE salary > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13083 | train |
v1 | Schema:
projects (alias: prj)(level, id, value, salary)
requests(date, type, level, amount)
Task: Select value from projects where level exists in requests for the same status.
SQL: | SELECT value FROM projects AS prj
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13084 | train |
v3 | Schema:
regions (alias: rgn)(id, amount, status, date)
transactions(name, level, id, type)
Task: Retrieve salary from regions with amount above the SUM(value) of transactions rows sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM transactions AS txn
WHERE txn.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13085 | train |
v3 | Schema:
employees (alias: emp)(code, amount, date, status)
shipments(code, salary, name, amount)
Task: Retrieve name from employees with salary above the SUM(amount) of shipments rows sharing the same type.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13086 | train |
v2 | Schema:
regions (alias: rgn)(value, amount, name, salary)
projects(amount, code, status, type)
Task: Find value from regions where a matching record exists in projects with the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13087 | train |
v1 | Schema:
categories (alias: catg)(status, value, date, id)
managers(date, id, type, code)
Task: Find amount from categories where type appears in managers entries with matching status.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13088 | train |
v3 | Schema:
transactions (alias: txn)(id, code, level, salary)
tasks(status, type, id, level)
Task: Find amount from transactions where amount exceeds the count of salary from tasks for the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13089 | train |
v3 | Schema:
shipments (alias: shp)(date, amount, id, code)
products(value, date, type, id)
Task: Find value from shipments where amount exceeds the average value from products for the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT AVG(value) FROM products AS prod
WHERE prod.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13090 | train |
v3 | Schema:
schedules (alias: schd)(type, level, salary, status)
regions(id, value, name, code)
Task: Retrieve salary from schedules with amount above the SUM(salary) of regions rows sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13091 | train |
v1 | Schema:
shipments (alias: shp)(level, value, salary, name)
departments(code, type, amount, value)
Task: Select amount from shipments where status exists in departments for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13092 | train |
v1 | Schema:
schedules (alias: schd)(code, id, amount, level)
projects(value, level, type, name)
Task: Retrieve amount from schedules whose id is found in projects rows where level matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13093 | train |
v1 | Schema:
accounts (alias: acct)(id, value, amount, status)
schedules(date, amount, id, level)
Task: Find amount from accounts where code appears in schedules entries with matching code.
SQL: | SELECT amount FROM accounts AS acct
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13094 | train |
v2 | Schema:
managers (alias: mgr)(date, value, level, id)
invoices(amount, salary, name, id)
Task: Find salary from managers where a matching record exists in invoices with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13095 | train |
v2 | Schema:
branches (alias: brc)(code, level, date, value)
staff(status, code, value, id)
Task: Find value from branches where a matching record exists in staff with the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13096 | train |
v3 | Schema:
accounts (alias: acct)(name, type, code, salary)
regions(status, id, value, amount)
Task: Retrieve id from accounts with salary above the MAX(salary) of regions rows sharing the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13097 | train |
v2 | Schema:
invoices (alias: inv)(status, date, name, id)
employees(name, type, code, salary)
Task: Retrieve amount from invoices that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13098 | train |
v1 | Schema:
items (alias: lne)(type, salary, amount, id)
departments(salary, level, date, type)
Task: Find code from items where code appears in departments entries with matching status.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.