variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
employees (alias: emp)(id, name, amount, level)
items(type, status, date, level)
Task: Find value from employees where a matching record exists in items with the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06800 | train |
v3 | Schema:
shipments (alias: shp)(name, value, id, amount)
orders(salary, code, amount, name)
Task: Retrieve id from shipments with salary above the COUNT(salary) of orders rows sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06801 | train |
v1 | Schema:
products (alias: prod)(salary, level, status, amount)
invoices(code, salary, level, id)
Task: Select amount from products where status exists in invoices for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = prod.id
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06802 | train |
v1 | Schema:
managers (alias: mgr)(date, amount, salary, type)
sales(status, date, level, name)
Task: Retrieve salary from managers whose level is found in sales rows where status matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06803 | train |
v2 | Schema:
transactions (alias: txn)(level, type, salary, id)
employees(value, id, level, status)
Task: Find id from transactions where a matching record exists in employees with the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06804 | train |
v1 | Schema:
categories (alias: catg)(code, status, date, amount)
regions(salary, amount, name, type)
Task: Find id from categories where type appears in regions entries with matching type.
SQL: | SELECT id FROM categories AS catg
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06805 | train |
v1 | Schema:
invoices (alias: inv)(status, value, type, code)
projects(amount, value, id, salary)
Task: Retrieve name from invoices whose id is found in projects rows where level matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06806 | train |
v3 | Schema:
customers (alias: cust)(code, level, id, salary)
transactions(id, status, level, date)
Task: Retrieve amount from customers with value above the COUNT(amount) of transactions rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06807 | train |
v2 | Schema:
shipments (alias: shp)(type, name, id, value)
requests(code, name, amount, type)
Task: Retrieve amount from shipments that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06808 | train |
v3 | Schema:
projects (alias: prj)(name, salary, level, status)
invoices(amount, code, name, level)
Task: Retrieve name from projects with salary above the SUM(amount) of invoices rows sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06809 | train |
v1 | Schema:
projects (alias: prj)(salary, code, status, type)
items(status, type, date, level)
Task: Find id from projects where type appears in items entries with matching id.
SQL: | SELECT id FROM projects AS prj
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06810 | train |
v2 | Schema:
staff (alias: empl)(id, salary, amount, name)
employees(type, salary, code, value)
Task: Retrieve code from staff that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06811 | train |
v1 | Schema:
shipments (alias: shp)(date, name, status, amount)
projects(amount, level, salary, code)
Task: Find value from shipments where id appears in projects entries with matching code.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06812 | train |
v3 | Schema:
projects (alias: prj)(value, level, id, salary)
managers(amount, level, id, date)
Task: Retrieve name from projects with value above the AVG(amount) of managers rows sharing the same code.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT AVG(amount) FROM managers AS mgr
WHERE mgr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06813 | train |
v1 | Schema:
customers (alias: cust)(date, code, name, value)
requests(code, status, type, level)
Task: Retrieve value from customers whose id is found in requests rows where level matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06814 | train |
v2 | Schema:
orders (alias: ord)(salary, code, value, name)
tasks(id, status, value, salary)
Task: Retrieve amount from orders that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06815 | train |
v1 | Schema:
orders (alias: ord)(status, type, name, date)
projects(type, value, level, id)
Task: Select code from orders where id exists in projects for the same status.
SQL: | SELECT code FROM orders AS ord
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06816 | train |
v1 | Schema:
schedules (alias: schd)(id, code, name, amount)
sales(status, salary, value, level)
Task: Retrieve name from schedules whose code is found in sales rows where id matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06817 | train |
v2 | Schema:
items (alias: lne)(type, salary, value, name)
products(code, name, amount, status)
Task: Find code from items where a matching record exists in products with the same code.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = lne.code
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_06818 | train |
v3 | Schema:
shipments (alias: shp)(name, code, id, salary)
staff(name, value, code, status)
Task: Retrieve name from shipments with value above the SUM(salary) of staff rows sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06819 | train |
v3 | Schema:
branches (alias: brc)(amount, salary, type, code)
categories(salary, type, id, date)
Task: Retrieve salary from branches with salary above the MAX(value) of categories rows sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE salary > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06820 | train |
v1 | Schema:
sales (alias: sale)(id, code, level, salary)
invoices(salary, amount, level, value)
Task: Select id from sales where id exists in invoices for the same level.
SQL: | SELECT id FROM sales AS sale
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06821 | train |
v1 | Schema:
tasks (alias: tsk)(date, amount, type, salary)
transactions(code, amount, salary, type)
Task: Select id from tasks where id exists in transactions for the same type.
SQL: | SELECT id FROM tasks AS tsk
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06822 | train |
v2 | Schema:
branches (alias: brc)(id, type, date, code)
sales(id, salary, date, amount)
Task: Retrieve name from branches that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06823 | train |
v2 | Schema:
sales (alias: sale)(status, date, value, level)
departments(name, type, value, date)
Task: Retrieve code from sales that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06824 | train |
v1 | Schema:
categories (alias: catg)(status, value, salary, code)
schedules(code, id, status, level)
Task: Retrieve value from categories whose type is found in schedules rows where code matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06825 | train |
v2 | Schema:
regions (alias: rgn)(id, status, amount, salary)
invoices(salary, id, amount, name)
Task: Find id from regions where a matching record exists in invoices with the same level.
SQL: | SELECT id 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": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06826 | train |
v2 | Schema:
tasks (alias: tsk)(level, name, id, status)
sales(name, value, id, status)
Task: Find amount from tasks where a matching record exists in sales with the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06827 | train |
v2 | Schema:
departments (alias: dept)(id, value, level, code)
invoices(code, level, name, id)
Task: Retrieve salary from departments that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06828 | train |
v2 | Schema:
staff (alias: empl)(amount, date, type, salary)
employees(name, level, value, code)
Task: Find id from staff where a matching record exists in employees with the same id.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06829 | train |
v3 | Schema:
sales (alias: sale)(level, type, amount, status)
products(date, id, name, code)
Task: Find code from sales where amount exceeds the count of amount from products for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06830 | train |
v3 | Schema:
products (alias: prod)(date, salary, value, id)
sales(value, name, code, amount)
Task: Find amount from products where amount exceeds the total salary from sales for the same id.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = prod.id
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06831 | train |
v1 | Schema:
invoices (alias: inv)(code, date, id, value)
projects(value, name, status, type)
Task: Select code from invoices where id exists in projects for the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06832 | train |
v2 | Schema:
projects (alias: prj)(value, level, code, date)
invoices(amount, id, date, type)
Task: Find name from projects where a matching record exists in invoices with the same code.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06833 | train |
v2 | Schema:
regions (alias: rgn)(name, date, type, status)
orders(status, id, type, value)
Task: Retrieve amount from regions that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06834 | train |
v2 | Schema:
regions (alias: rgn)(salary, amount, status, level)
accounts(date, value, salary, type)
Task: Retrieve name from regions that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06835 | train |
v2 | Schema:
branches (alias: brc)(amount, level, name, id)
orders(type, salary, date, amount)
Task: Find id from branches where a matching record exists in orders with the same code.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06836 | train |
v3 | Schema:
tasks (alias: tsk)(status, id, salary, date)
regions(date, type, value, code)
Task: Retrieve value from tasks with salary above the MIN(salary) of regions rows sharing the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06837 | train |
v1 | Schema:
managers (alias: mgr)(salary, level, code, amount)
tasks(type, status, date, amount)
Task: Find amount from managers where status appears in tasks entries with matching level.
SQL: | SELECT amount FROM managers AS mgr
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06838 | train |
v2 | Schema:
requests (alias: ordr)(date, level, value, status)
items(status, date, type, salary)
Task: Find name from requests where a matching record exists in items with the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06839 | train |
v1 | Schema:
products (alias: prod)(type, date, level, name)
accounts(status, level, amount, value)
Task: Find salary from products where status appears in accounts entries with matching type.
SQL: | SELECT salary FROM products AS prod
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = prod.type
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06840 | train |
v1 | Schema:
sales (alias: sale)(salary, name, amount, id)
items(type, value, salary, date)
Task: Find name from sales where code appears in items entries with matching code.
SQL: | SELECT name FROM sales AS sale
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06841 | train |
v2 | Schema:
sales (alias: sale)(status, date, level, type)
employees(value, code, status, id)
Task: Retrieve id from sales that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06842 | train |
v1 | Schema:
staff (alias: empl)(id, type, code, level)
schedules(value, type, name, id)
Task: Find name from staff where status appears in schedules entries with matching type.
SQL: | SELECT name FROM staff AS empl
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06843 | train |
v3 | Schema:
customers (alias: cust)(code, name, value, type)
tasks(name, type, code, salary)
Task: Find value from customers where salary exceeds the minimum salary from tasks for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06844 | train |
v1 | Schema:
orders (alias: ord)(date, level, value, status)
managers(type, date, level, status)
Task: Retrieve code from orders whose id is found in managers rows where id matches the outer record.
SQL: | SELECT code FROM orders AS ord
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06845 | train |
v1 | Schema:
categories (alias: catg)(date, status, id, name)
staff(name, type, amount, date)
Task: Find value from categories where type appears in staff entries with matching status.
SQL: | SELECT value FROM categories AS catg
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06846 | train |
v1 | Schema:
branches (alias: brc)(name, value, code, date)
staff(type, id, status, date)
Task: Find salary from branches where id appears in staff entries with matching id.
SQL: | SELECT salary FROM branches AS brc
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06847 | train |
v1 | Schema:
customers (alias: cust)(level, type, amount, salary)
invoices(status, name, code, type)
Task: Select name from customers where code exists in invoices for the same type.
SQL: | SELECT name FROM customers AS cust
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06848 | train |
v3 | Schema:
departments (alias: dept)(value, status, name, amount)
staff(code, name, id, salary)
Task: Retrieve id from departments with salary above the MIN(amount) of staff rows sharing the same type.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06849 | train |
v3 | Schema:
transactions (alias: txn)(level, name, type, status)
items(level, amount, value, name)
Task: Find code from transactions where value exceeds the total amount from items for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06850 | train |
v2 | Schema:
categories (alias: catg)(value, name, amount, date)
projects(level, status, id, value)
Task: Retrieve salary from categories that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06851 | train |
v3 | Schema:
categories (alias: catg)(id, name, type, date)
managers(value, type, code, date)
Task: Find name from categories where amount exceeds the count of salary from managers for the same id.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "name",
"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_06852 | train |
v2 | Schema:
accounts (alias: acct)(id, salary, level, status)
managers(code, date, name, amount)
Task: Retrieve name from accounts that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06853 | train |
v1 | Schema:
schedules (alias: schd)(value, type, level, id)
invoices(date, amount, status, salary)
Task: Find code from schedules where status appears in invoices entries with matching id.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06854 | train |
v2 | Schema:
shipments (alias: shp)(status, salary, id, date)
tasks(value, amount, name, status)
Task: Retrieve value from shipments that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_06855 | train |
v1 | Schema:
staff (alias: empl)(value, amount, level, name)
schedules(date, code, level, status)
Task: Select value from staff where id exists in schedules for the same type.
SQL: | SELECT value FROM staff AS empl
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06856 | train |
v2 | Schema:
schedules (alias: schd)(salary, date, name, level)
sales(code, id, value, date)
Task: Retrieve value from schedules that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06857 | train |
v3 | Schema:
projects (alias: prj)(amount, name, level, value)
categories(salary, amount, status, value)
Task: Retrieve name from projects with amount above the AVG(amount) of categories rows sharing the same status.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06858 | train |
v3 | Schema:
transactions (alias: txn)(type, code, level, name)
regions(amount, level, date, status)
Task: Find name from transactions where amount exceeds the minimum salary from regions for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"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_06859 | train |
v1 | Schema:
staff (alias: empl)(amount, type, name, salary)
projects(amount, status, name, value)
Task: Select name from staff where id exists in projects for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06860 | train |
v3 | Schema:
regions (alias: rgn)(type, id, value, code)
categories(value, status, amount, code)
Task: Find id from regions where salary exceeds the total amount from categories for the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06861 | train |
v2 | Schema:
regions (alias: rgn)(amount, id, type, name)
orders(value, code, name, status)
Task: Retrieve id from regions that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06862 | train |
v2 | Schema:
transactions (alias: txn)(amount, id, value, salary)
branches(name, value, date, salary)
Task: Find code from transactions where a matching record exists in branches with the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06863 | train |
v2 | Schema:
customers (alias: cust)(salary, status, id, date)
employees(date, code, salary, value)
Task: Find amount from customers where a matching record exists in employees with the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06864 | train |
v1 | Schema:
managers (alias: mgr)(code, status, type, name)
schedules(id, code, name, level)
Task: Find value from managers where id appears in schedules entries with matching status.
SQL: | SELECT value FROM managers AS mgr
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06865 | train |
v1 | Schema:
employees (alias: emp)(status, salary, value, code)
staff(level, name, amount, code)
Task: Find value from employees where level appears in staff entries with matching type.
SQL: | SELECT value FROM employees AS emp
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06866 | train |
v2 | Schema:
schedules (alias: schd)(type, level, code, date)
invoices(level, type, status, amount)
Task: Find amount from schedules where a matching record exists in invoices with the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06867 | train |
v3 | Schema:
employees (alias: emp)(salary, level, date, id)
tasks(level, status, value, name)
Task: Retrieve salary from employees with amount above the MAX(value) of tasks rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06868 | train |
v3 | Schema:
requests (alias: ordr)(value, id, level, status)
departments(status, id, date, name)
Task: Find amount from requests where value exceeds the minimum salary from departments for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_06869 | train |
v3 | Schema:
sales (alias: sale)(salary, amount, name, code)
schedules(type, date, name, id)
Task: Retrieve id from sales with value above the SUM(salary) of schedules rows sharing the same status.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06870 | train |
v3 | Schema:
categories (alias: catg)(status, date, type, level)
invoices(level, amount, type, id)
Task: Retrieve value from categories with salary above the MIN(amount) of invoices rows sharing the same id.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06871 | train |
v3 | Schema:
staff (alias: empl)(level, name, salary, amount)
accounts(name, value, level, type)
Task: Find id from staff where value exceeds the maximum value from accounts for the same level.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06872 | train |
v3 | Schema:
projects (alias: prj)(code, value, type, name)
customers(name, value, amount, level)
Task: Find code from projects where salary exceeds the total amount from customers for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE salary > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06873 | train |
v3 | Schema:
orders (alias: ord)(salary, amount, status, type)
accounts(date, level, value, salary)
Task: Retrieve id from orders with salary above the MAX(amount) of accounts rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06874 | train |
v2 | Schema:
projects (alias: prj)(date, status, salary, code)
schedules(code, type, level, status)
Task: Retrieve id from projects that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_06875 | train |
v2 | Schema:
branches (alias: brc)(salary, type, status, date)
tasks(value, code, salary, amount)
Task: Retrieve code from branches that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06876 | train |
v3 | Schema:
branches (alias: brc)(level, type, name, value)
orders(level, code, salary, status)
Task: Retrieve value from branches with value above the AVG(salary) of orders rows sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06877 | train |
v2 | Schema:
departments (alias: dept)(level, id, type, value)
branches(type, date, level, value)
Task: Retrieve value from departments that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06878 | train |
v2 | Schema:
regions (alias: rgn)(salary, status, code, amount)
invoices(type, salary, amount, status)
Task: Find salary from regions where a matching record exists in invoices with the same id.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_06879 | train |
v1 | Schema:
transactions (alias: txn)(name, type, amount, salary)
products(name, status, salary, date)
Task: Retrieve amount from transactions whose level is found in products rows where code matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06880 | train |
v3 | Schema:
schedules (alias: schd)(date, id, type, level)
customers(level, amount, id, status)
Task: Retrieve amount from schedules with value above the MIN(amount) of customers rows sharing the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_06881 | train |
v2 | Schema:
products (alias: prod)(amount, level, salary, code)
regions(amount, code, type, status)
Task: Retrieve value from products that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06882 | train |
v3 | Schema:
invoices (alias: inv)(status, salary, name, type)
categories(id, amount, type, name)
Task: Retrieve salary from invoices with value above the AVG(amount) of categories rows sharing the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06883 | train |
v1 | Schema:
branches (alias: brc)(salary, id, level, code)
invoices(value, amount, name, date)
Task: Find code from branches where id appears in invoices entries with matching level.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06884 | train |
v2 | Schema:
invoices (alias: inv)(value, status, id, salary)
branches(status, salary, level, amount)
Task: Find id from invoices where a matching record exists in branches with the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06885 | train |
v1 | Schema:
branches (alias: brc)(value, code, amount, status)
orders(salary, code, type, value)
Task: Retrieve value from branches whose code is found in orders rows where id matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06886 | train |
v2 | Schema:
customers (alias: cust)(date, value, type, amount)
categories(code, value, amount, salary)
Task: Find value from customers where a matching record exists in categories with the same code.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06887 | train |
v1 | Schema:
branches (alias: brc)(level, status, name, amount)
regions(id, status, salary, name)
Task: Retrieve name from branches whose id is found in regions rows where id matches the outer record.
SQL: | SELECT name FROM branches AS brc
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06888 | train |
v3 | Schema:
departments (alias: dept)(status, code, amount, value)
branches(status, name, date, value)
Task: Retrieve code from departments with amount above the COUNT(amount) of branches rows sharing the same type.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT COUNT(amount) FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06889 | train |
v3 | Schema:
branches (alias: brc)(id, value, type, amount)
categories(type, code, name, date)
Task: Retrieve value from branches with value above the MIN(salary) of categories rows sharing the same status.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06890 | train |
v2 | Schema:
branches (alias: brc)(date, value, type, status)
managers(code, amount, date, level)
Task: Find value from branches where a matching record exists in managers with the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06891 | train |
v2 | Schema:
sales (alias: sale)(salary, status, id, code)
managers(value, amount, name, code)
Task: Find value from sales where a matching record exists in managers with the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06892 | train |
v2 | Schema:
orders (alias: ord)(amount, name, salary, type)
sales(level, salary, date, amount)
Task: Find code from orders where a matching record exists in sales with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06893 | train |
v1 | Schema:
tasks (alias: tsk)(name, code, amount, type)
branches(type, level, name, amount)
Task: Find code from tasks where status appears in branches entries with matching id.
SQL: | SELECT code FROM tasks AS tsk
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06894 | train |
v2 | Schema:
branches (alias: brc)(date, salary, value, level)
invoices(date, amount, status, code)
Task: Find amount from branches where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_06895 | train |
v1 | Schema:
transactions (alias: txn)(amount, date, status, type)
shipments(code, date, status, level)
Task: Retrieve amount from transactions whose level is found in shipments rows where id matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06896 | train |
v1 | Schema:
staff (alias: empl)(id, name, value, type)
employees(type, level, value, id)
Task: Select id from staff where type exists in employees for the same code.
SQL: | SELECT id FROM staff AS empl
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_06897 | train |
v3 | Schema:
accounts (alias: acct)(type, code, level, date)
customers(date, value, status, code)
Task: Find amount from accounts where amount exceeds the total salary from customers for the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_06898 | train |
v2 | Schema:
tasks (alias: tsk)(date, type, name, value)
shipments(level, date, type, amount)
Task: Find amount from tasks where a matching record exists in shipments with the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_06899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.