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:
categories (alias: catg)(id, status, type, name)
projects(date, name, status, amount)
Task: Find name from categories where salary exceeds the average value from projects for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05300 | train |
v2 | Schema:
shipments (alias: shp)(amount, code, salary, id)
products(date, amount, code, value)
Task: Find id from shipments where a matching record exists in products with the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05301 | train |
v1 | Schema:
shipments (alias: shp)(name, value, code, date)
regions(salary, type, level, id)
Task: Retrieve name from shipments whose level is found in regions rows where id matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05302 | train |
v3 | Schema:
employees (alias: emp)(amount, date, name, code)
shipments(code, name, value, status)
Task: Retrieve salary from employees with value above the COUNT(salary) of shipments rows sharing the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05303 | train |
v3 | Schema:
products (alias: prod)(amount, type, level, code)
items(id, name, salary, value)
Task: Retrieve value from products with salary above the MAX(value) of items rows sharing the same id.
SQL: | SELECT value FROM products AS prod
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.id = prod.id
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05304 | train |
v1 | Schema:
projects (alias: prj)(type, id, amount, value)
accounts(date, salary, amount, code)
Task: Retrieve name from projects whose status is found in accounts rows where id matches the outer record.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05305 | train |
v2 | Schema:
managers (alias: mgr)(level, status, id, date)
invoices(status, code, id, amount)
Task: Find id from managers where a matching record exists in invoices with the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05306 | train |
v3 | Schema:
managers (alias: mgr)(level, name, type, value)
transactions(salary, value, code, amount)
Task: Find name from managers where amount exceeds the maximum salary from transactions for the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE amount > (
SELECT MAX(salary) FROM transactions AS txn
WHERE txn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05307 | train |
v3 | Schema:
shipments (alias: shp)(name, date, status, type)
managers(name, level, salary, code)
Task: Find salary from shipments where salary exceeds the average value from managers for the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05308 | train |
v3 | Schema:
shipments (alias: shp)(salary, code, value, type)
items(name, value, type, id)
Task: Find salary from shipments where salary exceeds the maximum salary from items for the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05309 | train |
v3 | Schema:
regions (alias: rgn)(level, date, status, salary)
items(type, status, value, id)
Task: Retrieve name from regions with salary above the AVG(value) of items rows sharing the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT AVG(value) FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "name",
"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_05310 | train |
v3 | Schema:
projects (alias: prj)(amount, value, salary, status)
departments(level, type, value, salary)
Task: Retrieve amount from projects with value above the AVG(amount) of departments rows sharing the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE value > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05311 | train |
v2 | Schema:
categories (alias: catg)(type, value, amount, name)
sales(date, name, salary, id)
Task: Find value from categories where a matching record exists in sales with 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_05312 | train |
v3 | Schema:
orders (alias: ord)(salary, amount, status, date)
items(name, code, date, id)
Task: Retrieve code from orders with value above the MAX(value) of items rows sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT MAX(value) FROM items AS lne
WHERE lne.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05313 | train |
v1 | Schema:
employees (alias: emp)(salary, name, code, level)
regions(name, code, value, status)
Task: Retrieve salary from employees whose id is found in regions rows where status matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id 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": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05314 | train |
v2 | Schema:
sales (alias: sale)(date, name, status, code)
tasks(salary, level, code, name)
Task: Find value from sales where a matching record exists in tasks with the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05315 | train |
v2 | Schema:
projects (alias: prj)(date, amount, salary, status)
shipments(code, name, id, amount)
Task: Retrieve amount from projects that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05316 | train |
v3 | Schema:
categories (alias: catg)(type, status, amount, code)
branches(level, amount, code, id)
Task: Retrieve name from categories with value above the MIN(salary) of branches rows sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT MIN(salary) FROM branches AS brc
WHERE brc.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05317 | train |
v3 | Schema:
schedules (alias: schd)(id, salary, status, level)
categories(amount, name, id, type)
Task: Find salary from schedules where value exceeds the maximum amount from categories for the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05318 | train |
v3 | Schema:
customers (alias: cust)(value, name, date, code)
accounts(name, level, type, amount)
Task: Find code from customers where value exceeds the average salary from accounts for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05319 | train |
v3 | Schema:
tasks (alias: tsk)(value, type, id, salary)
employees(name, salary, value, level)
Task: Retrieve value from tasks with value above the COUNT(value) of employees rows sharing the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05320 | train |
v3 | Schema:
requests (alias: ordr)(code, date, type, id)
accounts(code, id, salary, type)
Task: Find amount from requests where salary exceeds the maximum salary from accounts for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT MAX(salary) FROM accounts AS acct
WHERE acct.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05321 | train |
v2 | Schema:
regions (alias: rgn)(status, value, id, level)
products(name, amount, level, id)
Task: Retrieve name from regions that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05322 | train |
v3 | Schema:
departments (alias: dept)(status, salary, name, type)
items(salary, code, id, level)
Task: Retrieve code from departments with value above the COUNT(salary) of items rows sharing the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05323 | train |
v2 | Schema:
items (alias: lne)(code, name, salary, level)
employees(status, date, level, salary)
Task: Retrieve value from items that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05324 | train |
v3 | Schema:
regions (alias: rgn)(code, status, amount, salary)
categories(status, salary, code, type)
Task: Retrieve id from regions with amount above the MIN(salary) of categories rows sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05325 | train |
v3 | Schema:
sales (alias: sale)(status, type, value, code)
transactions(level, code, type, id)
Task: Find id from sales where value exceeds the count of amount from transactions for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05326 | train |
v3 | Schema:
invoices (alias: inv)(type, status, id, name)
employees(amount, value, salary, level)
Task: Find code from invoices where value exceeds the average salary from employees for the same code.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05327 | train |
v1 | Schema:
orders (alias: ord)(name, id, salary, code)
items(date, status, code, name)
Task: Retrieve value from orders whose status is found in items rows where type matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05328 | train |
v1 | Schema:
tasks (alias: tsk)(salary, amount, id, name)
projects(date, level, type, name)
Task: Retrieve code from tasks whose id is found in projects rows where id matches the outer record.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05329 | train |
v1 | Schema:
staff (alias: empl)(name, level, type, date)
regions(type, amount, level, code)
Task: Retrieve value from staff whose status is found in regions rows where level matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05330 | train |
v1 | Schema:
projects (alias: prj)(value, amount, code, id)
accounts(amount, name, salary, status)
Task: Find name from projects where status appears in accounts entries with matching status.
SQL: | SELECT name FROM projects AS prj
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05331 | train |
v2 | Schema:
employees (alias: emp)(salary, date, level, code)
projects(salary, level, id, name)
Task: Find salary from employees where a matching record exists in projects with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05332 | train |
v3 | Schema:
regions (alias: rgn)(level, name, salary, type)
employees(name, value, type, status)
Task: Find code from regions where salary exceeds the minimum salary from employees for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05333 | train |
v3 | Schema:
products (alias: prod)(code, level, value, status)
transactions(code, name, value, level)
Task: Find salary from products where amount exceeds the total salary from transactions for the same level.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05334 | train |
v1 | Schema:
orders (alias: ord)(status, id, code, date)
projects(value, name, date, amount)
Task: Retrieve value from orders whose level is found in projects rows where type matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05335 | train |
v2 | Schema:
regions (alias: rgn)(level, code, name, amount)
categories(name, type, value, id)
Task: Find id from regions where a matching record exists in categories with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05336 | train |
v1 | Schema:
categories (alias: catg)(code, value, type, amount)
customers(value, name, id, amount)
Task: Retrieve amount from categories whose id is found in customers rows where type matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05337 | train |
v1 | Schema:
products (alias: prod)(amount, level, status, code)
items(status, amount, value, id)
Task: Select code from products where id exists in items for the same status.
SQL: | SELECT code FROM products AS prod
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.status = prod.status
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05338 | train |
v2 | Schema:
accounts (alias: acct)(code, status, date, name)
regions(level, status, type, code)
Task: Find name from accounts where a matching record exists in regions with the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05339 | train |
v3 | Schema:
branches (alias: brc)(name, id, salary, level)
transactions(id, type, salary, status)
Task: Retrieve name from branches with salary above the MAX(amount) of transactions rows sharing the same level.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "brc",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05340 | train |
v2 | Schema:
shipments (alias: shp)(status, id, salary, level)
invoices(status, type, name, code)
Task: Retrieve amount from shipments that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05341 | train |
v3 | Schema:
transactions (alias: txn)(id, date, name, amount)
sales(status, level, name, salary)
Task: Retrieve name from transactions with amount above the MIN(salary) of sales rows sharing the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05342 | train |
v1 | Schema:
items (alias: lne)(name, level, code, date)
managers(name, amount, status, salary)
Task: Find code from items where id appears in managers entries with matching type.
SQL: | SELECT code FROM items AS lne
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05343 | train |
v1 | Schema:
products (alias: prod)(name, level, id, date)
accounts(name, salary, id, type)
Task: Select value from products where type exists in accounts for the same level.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05344 | train |
v3 | Schema:
staff (alias: empl)(value, id, salary, level)
employees(type, status, name, date)
Task: Retrieve name from staff with value above the AVG(salary) of employees rows sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05345 | train |
v3 | Schema:
products (alias: prod)(level, date, salary, type)
employees(salary, amount, value, status)
Task: Find code from products where salary exceeds the maximum amount from employees for the same code.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05346 | train |
v1 | Schema:
customers (alias: cust)(value, type, code, date)
transactions(amount, value, code, id)
Task: Find id from customers where code appears in transactions entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05347 | train |
v2 | Schema:
projects (alias: prj)(code, amount, type, level)
accounts(name, code, date, type)
Task: Find amount from projects where a matching record exists in accounts with the same level.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05348 | train |
v3 | Schema:
items (alias: lne)(code, type, value, date)
invoices(status, id, amount, name)
Task: Find amount from items where salary exceeds the total value from invoices for the same type.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.type = lne.type
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05349 | train |
v3 | Schema:
projects (alias: prj)(type, name, salary, level)
categories(level, amount, code, type)
Task: Retrieve code from projects with amount above the COUNT(value) of categories rows sharing the same status.
SQL: | SELECT code FROM projects AS prj
WHERE amount > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05350 | train |
v3 | Schema:
shipments (alias: shp)(value, name, type, salary)
regions(value, level, type, salary)
Task: Retrieve name from shipments with salary above the MAX(value) of regions rows sharing the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT MAX(value) FROM regions AS rgn
WHERE rgn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05351 | train |
v1 | Schema:
accounts (alias: acct)(id, amount, salary, code)
staff(value, level, salary, code)
Task: Retrieve value from accounts whose type is found in staff rows where code matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05352 | train |
v3 | Schema:
categories (alias: catg)(id, date, code, salary)
managers(date, status, salary, level)
Task: Retrieve value from categories with amount above the COUNT(amount) of managers rows sharing the same code.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05353 | train |
v3 | Schema:
schedules (alias: schd)(name, code, id, amount)
departments(name, id, salary, type)
Task: Find amount from schedules where value exceeds the count of salary from departments for the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05354 | train |
v1 | Schema:
regions (alias: rgn)(type, name, id, date)
customers(type, amount, id, level)
Task: Find amount from regions where level appears in customers entries with matching id.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05355 | train |
v1 | Schema:
projects (alias: prj)(date, type, amount, name)
regions(level, amount, name, salary)
Task: Select value from projects where level exists in regions for the same id.
SQL: | SELECT value FROM projects AS prj
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05356 | train |
v2 | Schema:
requests (alias: ordr)(date, code, name, id)
projects(type, code, salary, value)
Task: Retrieve salary from requests that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05357 | train |
v3 | Schema:
shipments (alias: shp)(name, date, amount, salary)
customers(id, salary, amount, date)
Task: Find code from shipments where amount exceeds the count of value from customers for the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05358 | train |
v3 | Schema:
transactions (alias: txn)(amount, date, salary, level)
items(type, salary, name, amount)
Task: Find name from transactions where salary exceeds the maximum salary from items for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05359 | train |
v1 | Schema:
categories (alias: catg)(salary, amount, name, type)
projects(status, value, salary, type)
Task: Find id from categories where status appears in projects entries with matching status.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05360 | train |
v2 | Schema:
staff (alias: empl)(value, name, amount, date)
invoices(date, status, amount, level)
Task: Retrieve id from staff that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05361 | train |
v2 | Schema:
products (alias: prod)(id, name, status, amount)
shipments(name, id, date, value)
Task: Retrieve id from products that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05362 | train |
v1 | Schema:
schedules (alias: schd)(amount, id, name, date)
transactions(code, level, value, id)
Task: Retrieve value from schedules whose type is found in transactions rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05363 | train |
v2 | Schema:
tasks (alias: tsk)(type, value, date, code)
invoices(type, level, status, code)
Task: Retrieve code from tasks that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05364 | train |
v3 | Schema:
orders (alias: ord)(id, value, amount, salary)
schedules(status, code, date, amount)
Task: Find name from orders where amount exceeds the minimum salary from schedules for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT MIN(salary) FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05365 | train |
v2 | Schema:
sales (alias: sale)(amount, id, date, type)
products(amount, level, status, value)
Task: Find value from sales where a matching record exists in products with the same type.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05366 | train |
v1 | Schema:
branches (alias: brc)(name, id, salary, level)
orders(id, amount, salary, status)
Task: Find id from branches where status appears in orders entries with matching code.
SQL: | SELECT id FROM branches AS brc
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05367 | train |
v2 | Schema:
employees (alias: emp)(salary, type, code, id)
departments(level, id, code, salary)
Task: Find id from employees where a matching record exists in departments with the same type.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05368 | train |
v1 | Schema:
requests (alias: ordr)(date, id, level, amount)
shipments(code, status, value, type)
Task: Retrieve id from requests whose id is found in shipments rows where code matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05369 | train |
v3 | Schema:
sales (alias: sale)(id, date, salary, name)
items(id, level, amount, name)
Task: Retrieve name from sales with amount above the SUM(salary) of items rows sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05370 | train |
v1 | Schema:
requests (alias: ordr)(status, type, salary, value)
products(name, date, value, salary)
Task: Retrieve id from requests whose status is found in products rows where code matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05371 | train |
v3 | Schema:
projects (alias: prj)(type, id, amount, value)
shipments(level, amount, code, status)
Task: Find amount from projects where salary exceeds the average salary from shipments for the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05372 | train |
v2 | Schema:
shipments (alias: shp)(value, amount, id, salary)
staff(id, name, code, level)
Task: Retrieve name from shipments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05373 | train |
v2 | Schema:
orders (alias: ord)(code, status, id, value)
accounts(level, value, date, type)
Task: Find value from orders where a matching record exists in accounts with the same code.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05374 | train |
v1 | Schema:
tasks (alias: tsk)(name, level, value, amount)
invoices(name, level, type, code)
Task: Select id from tasks where code exists in invoices for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05375 | train |
v2 | Schema:
categories (alias: catg)(value, salary, name, level)
projects(id, code, amount, value)
Task: Find amount from categories where a matching record exists in projects with the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05376 | train |
v1 | Schema:
accounts (alias: acct)(name, code, value, amount)
departments(level, status, name, date)
Task: Find id from accounts where type appears in departments entries with matching code.
SQL: | SELECT id FROM accounts AS acct
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05377 | train |
v3 | Schema:
projects (alias: prj)(amount, code, type, date)
schedules(value, status, level, name)
Task: Find name from projects where value exceeds the count of salary from schedules for the same level.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05378 | train |
v3 | Schema:
regions (alias: rgn)(level, type, name, code)
accounts(value, level, type, status)
Task: Retrieve value from regions with amount above the SUM(amount) of accounts rows sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05379 | train |
v1 | Schema:
requests (alias: ordr)(date, value, name, salary)
regions(name, salary, level, type)
Task: Retrieve code from requests whose code is found in regions rows where level matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05380 | train |
v2 | Schema:
shipments (alias: shp)(date, level, status, id)
managers(value, status, id, date)
Task: Find id from shipments where a matching record exists in managers with the same status.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05381 | train |
v2 | Schema:
items (alias: lne)(name, code, date, type)
employees(type, salary, value, id)
Task: Find id from items where a matching record exists in employees with the same type.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = lne.type
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05382 | train |
v1 | Schema:
projects (alias: prj)(amount, value, type, name)
products(code, type, date, salary)
Task: Find amount from projects where level appears in products entries with matching id.
SQL: | SELECT amount FROM projects AS prj
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05383 | train |
v1 | Schema:
departments (alias: dept)(type, value, salary, name)
regions(salary, type, amount, name)
Task: Retrieve salary from departments whose code is found in regions rows where level matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05384 | train |
v1 | Schema:
categories (alias: catg)(name, date, salary, amount)
orders(id, status, name, date)
Task: Select code from categories where id exists in orders for the same code.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05385 | train |
v2 | Schema:
requests (alias: ordr)(code, level, id, amount)
regions(id, level, date, type)
Task: Find salary from requests where a matching record exists in regions with the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05386 | train |
v1 | Schema:
employees (alias: emp)(code, type, level, status)
shipments(date, code, name, value)
Task: Retrieve code from employees whose code is found in shipments rows where level matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05387 | train |
v3 | Schema:
transactions (alias: txn)(value, amount, code, type)
staff(date, amount, value, id)
Task: Retrieve name from transactions with salary above the SUM(value) of staff rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05388 | train |
v2 | Schema:
orders (alias: ord)(code, date, status, level)
branches(id, status, value, type)
Task: Retrieve value from orders that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT value 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": "value",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05389 | train |
v2 | Schema:
schedules (alias: schd)(level, date, salary, code)
transactions(id, code, level, date)
Task: Find salary from schedules where a matching record exists in transactions with 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_05390 | train |
v1 | Schema:
requests (alias: ordr)(date, value, name, level)
regions(name, id, salary, code)
Task: Retrieve code from requests whose level is found in regions rows where id matches the outer record.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05391 | train |
v3 | Schema:
categories (alias: catg)(salary, level, id, status)
orders(type, level, id, status)
Task: Retrieve value from categories with amount above the MIN(value) of orders rows sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE amount > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05392 | train |
v2 | Schema:
schedules (alias: schd)(status, id, name, type)
staff(salary, type, code, amount)
Task: Retrieve code from schedules that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05393 | train |
v3 | Schema:
projects (alias: prj)(salary, level, type, value)
tasks(id, status, type, code)
Task: Retrieve salary from projects with value above the COUNT(salary) of tasks rows sharing the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE value > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "prj",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05394 | train |
v2 | Schema:
categories (alias: catg)(status, code, id, value)
employees(salary, id, amount, date)
Task: Retrieve code from categories that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05395 | train |
v3 | Schema:
customers (alias: cust)(name, amount, code, value)
schedules(salary, name, date, level)
Task: Retrieve code from customers with value above the AVG(salary) of schedules rows sharing the same status.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05396 | train |
v3 | Schema:
customers (alias: cust)(id, type, name, value)
sales(level, type, name, date)
Task: Find name from customers where salary exceeds the minimum value from sales for the same id.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05397 | train |
v3 | Schema:
tasks (alias: tsk)(name, salary, status, amount)
projects(id, salary, type, date)
Task: Find name from tasks where value exceeds the average amount from projects for the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE value > (
SELECT AVG(amount) FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05398 | train |
v3 | Schema:
categories (alias: catg)(status, date, amount, name)
shipments(level, status, amount, type)
Task: Retrieve id from categories with amount above the COUNT(salary) of shipments rows sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.