variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
tasks (alias: tsk)(id, code, type, salary)
requests(status, name, type, value)
Task: Retrieve salary from tasks with value above the AVG(salary) of requests rows sharing the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17300 | train |
v1 | Schema:
branches (alias: brc)(value, name, amount, type)
accounts(status, amount, date, level)
Task: Retrieve amount from branches whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17301 | train |
v3 | Schema:
schedules (alias: schd)(salary, type, amount, code)
invoices(date, level, code, type)
Task: Find amount from schedules where amount exceeds the minimum salary from invoices for the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17302 | train |
v2 | Schema:
categories (alias: catg)(value, code, level, date)
staff(salary, value, status, amount)
Task: Find code from categories where a matching record exists in staff with the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17303 | train |
v1 | Schema:
products (alias: prod)(status, amount, level, salary)
invoices(level, id, salary, status)
Task: Find id from products where code appears in invoices entries with matching id.
SQL: | SELECT id FROM products AS prod
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = prod.id
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17304 | train |
v2 | Schema:
staff (alias: empl)(amount, value, type, id)
departments(amount, level, type, date)
Task: Find salary from staff where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17305 | train |
v3 | Schema:
categories (alias: catg)(value, type, amount, code)
accounts(id, date, value, name)
Task: Find value from categories where value exceeds the total amount from accounts for the same id.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "value",
"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_17306 | train |
v1 | Schema:
requests (alias: ordr)(salary, type, level, id)
branches(id, value, level, name)
Task: Find code from requests where level appears in branches entries with matching status.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17307 | train |
v2 | Schema:
schedules (alias: schd)(date, level, amount, name)
transactions(amount, value, salary, date)
Task: Retrieve salary from schedules that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17308 | train |
v3 | Schema:
orders (alias: ord)(date, id, type, value)
items(status, type, amount, salary)
Task: Find amount from orders where salary exceeds the count of value from items for the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17309 | train |
v1 | Schema:
invoices (alias: inv)(type, salary, value, status)
transactions(date, salary, code, name)
Task: Select name from invoices where code exists in transactions for the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17310 | train |
v2 | Schema:
invoices (alias: inv)(level, amount, date, value)
projects(code, type, amount, id)
Task: Find code from invoices where a matching record exists in projects with the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17311 | train |
v2 | Schema:
shipments (alias: shp)(type, status, amount, name)
tasks(level, type, salary, id)
Task: Retrieve value from shipments that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17312 | train |
v1 | Schema:
categories (alias: catg)(amount, code, date, id)
invoices(value, code, status, level)
Task: Find code from categories where code appears in invoices entries with matching id.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17313 | train |
v3 | Schema:
items (alias: lne)(type, amount, date, id)
managers(amount, name, code, level)
Task: Find code from items where salary exceeds the total value from managers for the same code.
SQL: | SELECT code FROM items AS lne
WHERE salary > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17314 | train |
v2 | Schema:
categories (alias: catg)(date, type, level, value)
sales(amount, date, type, name)
Task: Retrieve value from categories that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17315 | train |
v3 | Schema:
customers (alias: cust)(name, type, level, value)
managers(level, value, id, name)
Task: Find code from customers where value exceeds the total amount from managers for the same id.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17316 | train |
v3 | Schema:
orders (alias: ord)(name, status, date, amount)
departments(amount, type, level, status)
Task: Find amount from orders where salary exceeds the total salary from departments for the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17317 | train |
v2 | Schema:
regions (alias: rgn)(status, amount, code, level)
invoices(status, value, code, type)
Task: Find salary from regions where a matching record exists in invoices with the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17318 | train |
v2 | Schema:
branches (alias: brc)(salary, level, type, code)
products(type, name, amount, level)
Task: Find code from branches where a matching record exists in products with the same id.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17319 | train |
v3 | Schema:
regions (alias: rgn)(salary, type, id, code)
projects(salary, id, status, date)
Task: Find code from regions where salary exceeds the minimum amount from projects for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17320 | train |
v2 | Schema:
items (alias: lne)(id, value, code, type)
tasks(amount, id, date, value)
Task: Find code from items where a matching record exists in tasks with the same code.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17321 | train |
v1 | Schema:
managers (alias: mgr)(amount, level, name, type)
branches(id, amount, level, type)
Task: Find code from managers where status appears in branches entries with matching code.
SQL: | SELECT code FROM managers AS mgr
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17322 | train |
v2 | Schema:
orders (alias: ord)(id, salary, date, level)
schedules(name, status, salary, date)
Task: Retrieve amount from orders that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17323 | train |
v1 | Schema:
orders (alias: ord)(type, id, value, date)
regions(date, value, type, id)
Task: Select id from orders where level exists in regions for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17324 | train |
v2 | Schema:
sales (alias: sale)(date, salary, amount, type)
branches(id, value, amount, level)
Task: Retrieve salary from sales that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17325 | train |
v2 | Schema:
staff (alias: empl)(level, value, name, status)
orders(status, id, type, level)
Task: Retrieve value from staff that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17326 | train |
v1 | Schema:
categories (alias: catg)(amount, id, status, type)
accounts(value, level, code, date)
Task: Find name from categories where id appears in accounts entries with matching level.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17327 | train |
v1 | Schema:
items (alias: lne)(type, date, code, id)
customers(name, type, date, amount)
Task: Find value from items where code appears in customers entries with matching level.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17328 | train |
v2 | Schema:
transactions (alias: txn)(status, type, name, value)
customers(level, status, id, name)
Task: Find amount from transactions where a matching record exists in customers with the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17329 | train |
v3 | Schema:
sales (alias: sale)(name, status, id, salary)
products(name, level, code, date)
Task: Find id from sales where amount exceeds the minimum value from products for the same type.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT MIN(value) FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17330 | train |
v2 | Schema:
regions (alias: rgn)(type, amount, value, level)
projects(id, name, salary, level)
Task: Find value from regions where a matching record exists in projects with the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17331 | train |
v2 | Schema:
customers (alias: cust)(salary, value, level, date)
managers(type, status, id, date)
Task: Retrieve salary from customers that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17332 | train |
v3 | Schema:
invoices (alias: inv)(code, status, value, amount)
employees(status, level, date, salary)
Task: Retrieve amount from invoices with value above the COUNT(value) of employees rows sharing the same status.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17333 | train |
v3 | Schema:
items (alias: lne)(status, type, id, date)
regions(type, salary, status, amount)
Task: Find amount from items where value exceeds the average salary from regions for the same level.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17334 | train |
v2 | Schema:
invoices (alias: inv)(salary, name, date, level)
branches(id, amount, status, value)
Task: Find id from invoices where a matching record exists in branches with the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17335 | train |
v2 | Schema:
regions (alias: rgn)(status, value, level, type)
products(amount, level, date, id)
Task: Retrieve id from regions that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17336 | train |
v3 | Schema:
items (alias: lne)(type, code, id, date)
schedules(salary, id, status, type)
Task: Find salary from items where amount exceeds the minimum salary from schedules for the same id.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.id = lne.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17337 | train |
v3 | Schema:
schedules (alias: schd)(amount, id, code, value)
departments(code, date, salary, amount)
Task: Retrieve amount from schedules with amount above the COUNT(salary) of departments rows sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17338 | train |
v2 | Schema:
shipments (alias: shp)(date, amount, type, code)
items(id, code, amount, name)
Task: Retrieve id from shipments that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17339 | train |
v2 | Schema:
orders (alias: ord)(id, status, value, code)
branches(name, amount, code, level)
Task: Find amount from orders where a matching record exists in branches with the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17340 | train |
v3 | Schema:
projects (alias: prj)(value, amount, salary, id)
invoices(type, salary, id, date)
Task: Find salary from projects where amount exceeds the count of amount from invoices for the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17341 | train |
v3 | Schema:
managers (alias: mgr)(amount, date, name, id)
projects(type, id, code, value)
Task: Retrieve code from managers with value above the AVG(salary) of projects rows sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17342 | train |
v1 | Schema:
employees (alias: emp)(type, date, status, id)
departments(level, name, salary, code)
Task: Select name from employees where level exists in departments for the same id.
SQL: | SELECT name FROM employees AS emp
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17343 | train |
v3 | Schema:
sales (alias: sale)(level, type, date, amount)
orders(level, type, name, id)
Task: Retrieve salary from sales with salary above the MAX(value) of orders rows sharing the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17344 | train |
v1 | Schema:
requests (alias: ordr)(date, amount, code, salary)
projects(amount, code, status, level)
Task: Select amount from requests where code exists in projects for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17345 | train |
v3 | Schema:
requests (alias: ordr)(level, code, name, date)
staff(amount, date, salary, type)
Task: Find salary from requests where value exceeds the average amount from staff for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT AVG(amount) FROM staff AS empl
WHERE empl.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17346 | train |
v2 | Schema:
sales (alias: sale)(value, type, name, date)
projects(status, level, code, value)
Task: Retrieve name from sales that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17347 | train |
v3 | Schema:
invoices (alias: inv)(date, status, salary, id)
products(amount, id, name, salary)
Task: Retrieve name from invoices with value above the SUM(salary) of products rows sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE value > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17348 | train |
v2 | Schema:
invoices (alias: inv)(code, salary, name, date)
managers(id, amount, type, date)
Task: Retrieve amount from invoices that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17349 | train |
v1 | Schema:
regions (alias: rgn)(value, salary, date, type)
staff(code, date, type, amount)
Task: Retrieve code from regions whose status is found in staff rows where level matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_17350 | train |
v3 | Schema:
schedules (alias: schd)(date, level, type, value)
regions(name, salary, value, status)
Task: Find salary from schedules where amount exceeds the minimum value from regions for the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17351 | train |
v1 | Schema:
accounts (alias: acct)(level, value, amount, date)
employees(amount, value, salary, id)
Task: Retrieve amount from accounts whose id is found in employees rows where level matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17352 | train |
v3 | Schema:
shipments (alias: shp)(value, amount, status, level)
tasks(id, name, level, salary)
Task: Retrieve code from shipments with amount above the SUM(salary) of tasks rows sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17353 | train |
v1 | Schema:
categories (alias: catg)(date, code, type, status)
sales(value, status, level, type)
Task: Select code from categories where type exists in sales for the same status.
SQL: | SELECT code FROM categories AS catg
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17354 | train |
v2 | Schema:
items (alias: lne)(code, amount, date, level)
orders(type, value, name, amount)
Task: Find code from items where a matching record exists in orders with the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17355 | train |
v1 | Schema:
managers (alias: mgr)(value, level, code, amount)
orders(id, date, value, level)
Task: Retrieve name from managers whose level is found in orders rows where type matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17356 | train |
v3 | Schema:
employees (alias: emp)(value, type, id, amount)
requests(salary, amount, date, value)
Task: Find salary from employees where value exceeds the average salary from requests for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17357 | train |
v3 | Schema:
requests (alias: ordr)(id, date, level, name)
regions(status, id, value, level)
Task: Retrieve salary from requests with value above the AVG(value) of regions rows sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17358 | train |
v2 | Schema:
tasks (alias: tsk)(salary, amount, value, id)
items(salary, id, name, amount)
Task: Retrieve id from tasks that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17359 | train |
v1 | Schema:
categories (alias: catg)(value, code, amount, date)
shipments(name, amount, type, level)
Task: Find code from categories where type appears in shipments entries with matching level.
SQL: | SELECT code FROM categories AS catg
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17360 | train |
v3 | Schema:
staff (alias: empl)(name, date, code, type)
transactions(value, code, name, salary)
Task: Find salary from staff where amount exceeds the average value from transactions for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17361 | train |
v2 | Schema:
categories (alias: catg)(type, amount, value, id)
sales(value, status, amount, id)
Task: Find salary from categories where a matching record exists in sales with the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17362 | train |
v1 | Schema:
categories (alias: catg)(id, code, status, name)
employees(salary, type, date, amount)
Task: Select value from categories where type exists in employees for the same status.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17363 | train |
v2 | Schema:
products (alias: prod)(value, level, salary, type)
categories(type, level, value, amount)
Task: Find amount from products where a matching record exists in categories with the same status.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = prod.status
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17364 | train |
v2 | Schema:
customers (alias: cust)(type, value, name, code)
schedules(status, amount, type, code)
Task: Retrieve salary from customers that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17365 | train |
v3 | Schema:
tasks (alias: tsk)(salary, value, code, status)
accounts(amount, salary, name, level)
Task: Find name from tasks where value exceeds the count of amount from accounts for the same code.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17366 | train |
v1 | Schema:
branches (alias: brc)(status, amount, id, code)
staff(salary, date, value, level)
Task: Find salary from branches where type appears in staff entries with matching type.
SQL: | SELECT salary FROM branches AS brc
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17367 | train |
v2 | Schema:
products (alias: prod)(status, date, code, level)
branches(value, code, amount, type)
Task: Find code from products where a matching record exists in branches with the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = prod.id
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17368 | train |
v2 | Schema:
accounts (alias: acct)(level, amount, code, status)
branches(level, value, salary, amount)
Task: Retrieve id from accounts that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17369 | train |
v1 | Schema:
projects (alias: prj)(amount, code, name, id)
shipments(name, code, salary, date)
Task: Select amount from projects where code exists in shipments for the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17370 | train |
v1 | Schema:
items (alias: lne)(level, amount, code, name)
regions(level, code, type, amount)
Task: Find code from items where status appears in regions entries with matching status.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_17371 | train |
v3 | Schema:
sales (alias: sale)(code, salary, level, name)
requests(date, status, amount, name)
Task: Retrieve amount from sales with value above the AVG(value) of requests rows sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17372 | train |
v3 | Schema:
invoices (alias: inv)(value, amount, status, code)
employees(status, level, value, name)
Task: Retrieve name from invoices with amount above the AVG(value) of employees rows sharing the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT AVG(value) FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17373 | train |
v1 | Schema:
managers (alias: mgr)(value, level, salary, date)
customers(name, code, status, salary)
Task: Select value from managers where level exists in customers for the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17374 | train |
v3 | Schema:
orders (alias: ord)(date, level, name, type)
sales(level, id, type, value)
Task: Retrieve amount from orders with amount above the MAX(salary) of sales rows sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17375 | train |
v3 | Schema:
shipments (alias: shp)(code, date, salary, name)
employees(type, value, amount, level)
Task: Find value from shipments where salary exceeds the count of value from employees for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_17376 | train |
v2 | Schema:
staff (alias: empl)(date, status, code, level)
requests(level, status, amount, name)
Task: Retrieve value from staff that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17377 | train |
v1 | Schema:
sales (alias: sale)(type, id, value, level)
items(name, status, amount, date)
Task: Select code from sales where type exists in items for the same id.
SQL: | SELECT code FROM sales AS sale
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17378 | train |
v1 | Schema:
orders (alias: ord)(type, amount, name, level)
schedules(code, type, level, salary)
Task: Find salary from orders where code appears in schedules entries with matching id.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17379 | train |
v3 | Schema:
staff (alias: empl)(status, name, code, salary)
employees(code, date, status, name)
Task: Retrieve code from staff with salary above the AVG(amount) of employees rows sharing the same level.
SQL: | SELECT code FROM staff AS empl
WHERE salary > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17380 | train |
v1 | Schema:
accounts (alias: acct)(level, id, value, type)
products(date, salary, amount, level)
Task: Retrieve amount from accounts whose status is found in products rows where id matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17381 | train |
v3 | Schema:
tasks (alias: tsk)(code, type, salary, name)
branches(name, value, status, code)
Task: Find salary from tasks where amount exceeds the minimum value from branches for the same type.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17382 | train |
v2 | Schema:
managers (alias: mgr)(code, type, salary, date)
shipments(date, value, salary, name)
Task: Find code from managers where a matching record exists in shipments with the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17383 | train |
v2 | Schema:
categories (alias: catg)(salary, type, value, status)
tasks(salary, type, date, id)
Task: Find id from categories where a matching record exists in tasks with the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17384 | train |
v3 | Schema:
schedules (alias: schd)(amount, salary, type, value)
staff(value, id, code, level)
Task: Retrieve id from schedules with value above the AVG(value) of staff rows sharing the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17385 | train |
v2 | Schema:
orders (alias: ord)(date, code, level, salary)
items(salary, amount, name, level)
Task: Find amount from orders where a matching record exists in items with the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17386 | train |
v3 | Schema:
schedules (alias: schd)(type, salary, name, id)
tasks(amount, level, date, type)
Task: Find value from schedules where value exceeds the average amount from tasks for the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_17387 | train |
v3 | Schema:
branches (alias: brc)(id, amount, type, salary)
invoices(amount, id, salary, type)
Task: Find value from branches where value exceeds the minimum value from invoices for the same id.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17388 | train |
v3 | Schema:
tasks (alias: tsk)(date, name, id, salary)
transactions(status, date, salary, code)
Task: Find value from tasks where value exceeds the count of amount from transactions for the same level.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17389 | train |
v3 | Schema:
tasks (alias: tsk)(code, type, amount, date)
shipments(date, value, salary, type)
Task: Retrieve salary from tasks with amount above the COUNT(value) of shipments rows sharing the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_17390 | train |
v3 | Schema:
orders (alias: ord)(id, name, value, status)
accounts(salary, amount, value, name)
Task: Find salary from orders where amount exceeds the maximum value from accounts for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17391 | train |
v2 | Schema:
branches (alias: brc)(status, value, code, type)
projects(code, type, amount, date)
Task: Find name from branches where a matching record exists in projects with the same status.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_17392 | train |
v3 | Schema:
customers (alias: cust)(salary, type, value, name)
items(date, status, level, amount)
Task: Retrieve id from customers with amount above the COUNT(value) of items rows sharing the same status.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17393 | train |
v3 | Schema:
staff (alias: empl)(type, status, code, salary)
customers(salary, amount, id, type)
Task: Retrieve salary from staff with salary above the MIN(amount) of customers rows sharing the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17394 | train |
v2 | Schema:
requests (alias: ordr)(name, code, amount, id)
sales(type, level, code, salary)
Task: Retrieve code from requests that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_17395 | train |
v1 | Schema:
projects (alias: prj)(status, name, id, amount)
orders(name, status, id, amount)
Task: Retrieve value from projects whose id is found in orders rows where type matches the outer record.
SQL: | SELECT value FROM projects AS prj
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_17396 | train |
v1 | Schema:
staff (alias: empl)(salary, date, status, id)
regions(name, amount, salary, code)
Task: Select name from staff where level exists in regions for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_17397 | train |
v2 | Schema:
products (alias: prod)(name, status, date, type)
items(code, amount, salary, value)
Task: Find code from products where a matching record exists in items with the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = prod.status
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17398 | train |
v1 | Schema:
transactions (alias: txn)(name, id, salary, type)
tasks(id, level, amount, value)
Task: Retrieve name from transactions whose code is found in tasks rows where level matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_17399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.