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:
regions (alias: rgn)(value, type, code, salary)
sales(date, name, level, status)
Task: Retrieve code from regions that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13100 | train |
v3 | Schema:
departments (alias: dept)(salary, value, id, code)
branches(value, name, level, salary)
Task: Retrieve value from departments with salary above the MAX(value) of branches rows sharing the same type.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13101 | train |
v2 | Schema:
managers (alias: mgr)(type, value, name, status)
schedules(id, date, level, code)
Task: Retrieve name from managers that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13102 | train |
v2 | Schema:
employees (alias: emp)(type, code, salary, status)
invoices(salary, code, type, value)
Task: Retrieve id from employees that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13103 | train |
v2 | Schema:
regions (alias: rgn)(status, salary, code, date)
invoices(code, name, status, id)
Task: Find code from regions where a matching record exists in invoices with the same id.
SQL: | SELECT code 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": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13104 | train |
v3 | Schema:
schedules (alias: schd)(type, name, level, value)
staff(level, amount, code, salary)
Task: Find id from schedules where salary exceeds the average salary from staff for the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13105 | train |
v2 | Schema:
departments (alias: dept)(amount, value, salary, id)
employees(salary, code, date, type)
Task: Retrieve salary from departments that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13106 | train |
v1 | Schema:
items (alias: lne)(code, salary, level, id)
requests(date, code, status, id)
Task: Retrieve name from items whose level is found in requests rows where code matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13107 | train |
v2 | Schema:
customers (alias: cust)(value, type, amount, level)
orders(value, name, date, amount)
Task: Retrieve amount from customers that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13108 | train |
v1 | Schema:
schedules (alias: schd)(date, value, amount, status)
employees(date, name, value, type)
Task: Retrieve value from schedules whose type is found in employees rows where level matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13109 | train |
v1 | Schema:
regions (alias: rgn)(code, salary, amount, date)
invoices(status, level, code, id)
Task: Find value from regions where status appears in invoices entries with matching status.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13110 | train |
v1 | Schema:
items (alias: lne)(name, amount, status, type)
orders(type, id, salary, status)
Task: Select code from items where code exists in orders for the same id.
SQL: | SELECT code FROM items AS lne
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = lne.id
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13111 | train |
v1 | Schema:
transactions (alias: txn)(amount, level, type, status)
customers(type, salary, code, id)
Task: Retrieve salary from transactions whose type is found in customers rows where id matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13112 | train |
v1 | Schema:
employees (alias: emp)(value, level, id, code)
projects(type, code, amount, level)
Task: Retrieve salary from employees whose id is found in projects rows where id matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13113 | train |
v2 | Schema:
schedules (alias: schd)(status, level, salary, type)
products(id, salary, amount, date)
Task: Find id from schedules where a matching record exists in products with the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13114 | train |
v1 | Schema:
orders (alias: ord)(value, name, salary, type)
items(date, amount, value, id)
Task: Select salary from orders where code exists in items for the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13115 | train |
v1 | Schema:
managers (alias: mgr)(value, level, amount, type)
accounts(id, code, type, salary)
Task: Find code from managers where type appears in accounts entries with matching type.
SQL: | SELECT code FROM managers AS mgr
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13116 | train |
v1 | Schema:
managers (alias: mgr)(id, value, amount, date)
customers(date, status, level, id)
Task: Retrieve amount from managers whose code is found in customers rows where level matches the outer record.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13117 | train |
v1 | Schema:
accounts (alias: acct)(status, name, code, salary)
schedules(type, amount, status, id)
Task: Find salary from accounts where status appears in schedules entries with matching type.
SQL: | SELECT salary FROM accounts AS acct
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13118 | train |
v1 | Schema:
sales (alias: sale)(name, status, salary, value)
customers(code, status, id, type)
Task: Select amount from sales where status exists in customers for the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13119 | train |
v1 | Schema:
invoices (alias: inv)(date, type, amount, code)
sales(status, amount, code, type)
Task: Select id from invoices where status exists in sales for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13120 | train |
v3 | Schema:
customers (alias: cust)(date, code, status, amount)
regions(status, type, value, amount)
Task: Retrieve value from customers with salary above the MIN(value) of regions rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13121 | train |
v1 | Schema:
items (alias: lne)(id, amount, type, date)
employees(type, id, date, amount)
Task: Find salary from items where id appears in employees entries with matching level.
SQL: | SELECT salary FROM items AS lne
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13122 | train |
v2 | Schema:
requests (alias: ordr)(date, code, salary, status)
shipments(value, amount, date, type)
Task: Retrieve id from requests that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13123 | train |
v3 | Schema:
employees (alias: emp)(value, date, status, code)
orders(amount, type, code, value)
Task: Retrieve code from employees with salary above the AVG(value) of orders rows sharing the same id.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13124 | train |
v3 | Schema:
categories (alias: catg)(id, status, date, level)
schedules(value, date, status, salary)
Task: Retrieve id from categories with value above the MIN(value) of schedules rows sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13125 | train |
v3 | Schema:
regions (alias: rgn)(name, level, status, id)
departments(name, level, date, salary)
Task: Find code from regions where salary exceeds the count of amount from departments for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13126 | train |
v2 | Schema:
invoices (alias: inv)(salary, level, amount, code)
products(id, date, amount, name)
Task: Find code from invoices where a matching record exists in products with the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13127 | train |
v2 | Schema:
projects (alias: prj)(code, salary, id, value)
orders(name, type, level, status)
Task: Find amount from projects where a matching record exists in orders with the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13128 | train |
v2 | Schema:
employees (alias: emp)(name, amount, type, salary)
staff(id, amount, date, type)
Task: Retrieve id from employees that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13129 | train |
v2 | Schema:
categories (alias: catg)(salary, amount, name, level)
regions(code, level, date, salary)
Task: Find code from categories where a matching record exists in regions with the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13130 | train |
v3 | Schema:
branches (alias: brc)(value, type, level, name)
orders(type, salary, id, name)
Task: Retrieve id from branches with salary above the AVG(salary) of orders rows sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT AVG(salary) FROM orders AS ord
WHERE ord.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13131 | train |
v1 | Schema:
categories (alias: catg)(code, value, name, level)
items(type, code, id, salary)
Task: Find code from categories where type appears in items entries with matching status.
SQL: | SELECT code FROM categories AS catg
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13132 | train |
v2 | Schema:
customers (alias: cust)(name, amount, salary, date)
orders(name, status, salary, type)
Task: Find value from customers where a matching record exists in orders with the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13133 | train |
v2 | Schema:
shipments (alias: shp)(salary, level, code, date)
orders(code, type, amount, date)
Task: Retrieve salary from shipments that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13134 | train |
v2 | Schema:
items (alias: lne)(value, date, status, code)
staff(date, id, name, level)
Task: Retrieve id from items that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = lne.code
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13135 | train |
v1 | Schema:
requests (alias: ordr)(level, date, id, salary)
orders(level, date, code, name)
Task: Select amount from requests where id exists in orders for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13136 | train |
v1 | Schema:
products (alias: prod)(status, code, salary, value)
orders(amount, level, value, salary)
Task: Retrieve id from products whose id is found in orders rows where level matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.level = prod.level
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13137 | train |
v1 | Schema:
departments (alias: dept)(amount, value, name, code)
products(code, status, type, level)
Task: Retrieve amount from departments whose level is found in products rows where type matches the outer record.
SQL: | SELECT amount FROM departments AS dept
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13138 | train |
v3 | Schema:
products (alias: prod)(salary, type, status, id)
customers(id, code, name, type)
Task: Find salary from products where amount exceeds the total salary from customers for the same code.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13139 | train |
v3 | Schema:
managers (alias: mgr)(type, code, status, value)
products(value, type, id, amount)
Task: Retrieve amount from managers with value above the MIN(amount) of products rows sharing the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13140 | train |
v2 | Schema:
accounts (alias: acct)(id, salary, type, code)
staff(type, value, level, salary)
Task: Find code from accounts where a matching record exists in staff with the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13141 | train |
v1 | Schema:
employees (alias: emp)(status, value, date, level)
managers(level, code, salary, amount)
Task: Select name from employees where type exists in managers for the same status.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13142 | train |
v2 | Schema:
transactions (alias: txn)(amount, id, code, type)
branches(type, value, id, name)
Task: Find salary from transactions where a matching record exists in branches with the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13143 | train |
v3 | Schema:
requests (alias: ordr)(status, salary, id, code)
invoices(type, code, status, date)
Task: Find name from requests where amount exceeds the count of amount from invoices for the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13144 | train |
v3 | Schema:
managers (alias: mgr)(code, id, value, date)
customers(id, date, salary, level)
Task: Retrieve code from managers with value above the SUM(value) of customers rows sharing the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13145 | train |
v1 | Schema:
employees (alias: emp)(date, status, type, salary)
requests(status, amount, date, name)
Task: Find code from employees where level appears in requests entries with matching id.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13146 | train |
v1 | Schema:
requests (alias: ordr)(type, code, value, name)
schedules(status, date, value, amount)
Task: Retrieve amount from requests whose status is found in schedules rows where id matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13147 | train |
v2 | Schema:
departments (alias: dept)(code, type, level, salary)
orders(amount, salary, code, id)
Task: Find name from departments where a matching record exists in orders with the same level.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13148 | train |
v1 | Schema:
regions (alias: rgn)(id, amount, name, date)
shipments(code, amount, id, date)
Task: Select value from regions where level exists in shipments for the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13149 | train |
v3 | Schema:
items (alias: lne)(code, date, salary, type)
staff(type, status, value, amount)
Task: Find name from items where amount exceeds the average salary from staff for the same type.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13150 | train |
v2 | Schema:
orders (alias: ord)(value, level, amount, type)
shipments(code, id, value, type)
Task: Find salary from orders where a matching record exists in shipments with the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13151 | train |
v3 | Schema:
orders (alias: ord)(type, code, level, date)
sales(level, name, id, type)
Task: Retrieve amount from orders with value above the MIN(salary) of sales rows sharing the same type.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13152 | train |
v3 | Schema:
invoices (alias: inv)(value, status, salary, type)
orders(type, name, level, id)
Task: Find salary from invoices where value exceeds the maximum salary from orders for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13153 | train |
v1 | Schema:
managers (alias: mgr)(name, id, date, code)
orders(amount, code, date, id)
Task: Select code from managers where level exists in orders for the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13154 | train |
v2 | Schema:
employees (alias: emp)(name, date, type, salary)
staff(name, level, date, type)
Task: Find value from employees where a matching record exists in staff with the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13155 | train |
v3 | Schema:
shipments (alias: shp)(status, amount, level, value)
requests(type, code, status, level)
Task: Find amount from shipments where salary exceeds the total salary from requests for the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_13156 | train |
v3 | Schema:
staff (alias: empl)(type, code, salary, value)
sales(date, name, type, level)
Task: Retrieve salary from staff with amount above the SUM(value) of sales rows sharing the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13157 | train |
v2 | Schema:
transactions (alias: txn)(date, status, id, level)
projects(amount, value, type, salary)
Task: Retrieve name from transactions that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13158 | train |
v1 | Schema:
employees (alias: emp)(name, amount, id, date)
regions(type, date, name, code)
Task: Retrieve salary from employees whose id is found in regions rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13159 | train |
v1 | Schema:
staff (alias: empl)(salary, id, level, name)
categories(status, value, amount, name)
Task: Select code from staff where id exists in categories for the same id.
SQL: | SELECT code FROM staff AS empl
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13160 | train |
v1 | Schema:
managers (alias: mgr)(name, value, id, type)
sales(level, date, name, value)
Task: Find value from managers where level appears in sales entries with matching id.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13161 | train |
v2 | Schema:
accounts (alias: acct)(status, level, id, date)
employees(code, status, salary, id)
Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13162 | train |
v2 | Schema:
categories (alias: catg)(name, code, salary, level)
orders(name, level, amount, date)
Task: Retrieve value from categories that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13163 | train |
v3 | Schema:
branches (alias: brc)(id, status, value, amount)
employees(level, type, value, amount)
Task: Find value from branches where salary exceeds the count of salary from employees for the same id.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13164 | train |
v2 | Schema:
orders (alias: ord)(amount, type, value, code)
tasks(salary, amount, level, type)
Task: Retrieve amount from orders that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13165 | train |
v3 | Schema:
departments (alias: dept)(name, level, type, value)
invoices(id, status, value, date)
Task: Retrieve value from departments with value above the SUM(salary) of invoices rows sharing the same type.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13166 | train |
v2 | Schema:
staff (alias: empl)(code, salary, date, name)
employees(id, level, date, amount)
Task: Retrieve code from staff that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13167 | train |
v3 | Schema:
departments (alias: dept)(amount, status, value, name)
customers(salary, value, date, id)
Task: Find name from departments where value exceeds the average amount from customers for the same level.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13168 | train |
v1 | Schema:
staff (alias: empl)(salary, amount, level, id)
departments(date, level, code, salary)
Task: Retrieve value from staff whose status is found in departments rows where type matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_13169 | train |
v3 | Schema:
invoices (alias: inv)(code, id, date, level)
shipments(type, name, amount, value)
Task: Find name from invoices where amount exceeds the minimum amount from shipments for the same type.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT MIN(amount) FROM shipments AS shp
WHERE shp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13170 | train |
v3 | Schema:
orders (alias: ord)(salary, date, type, code)
accounts(amount, value, date, status)
Task: Retrieve id from orders with value above the AVG(salary) of accounts rows sharing the same code.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT AVG(salary) FROM accounts AS acct
WHERE acct.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13171 | train |
v1 | Schema:
transactions (alias: txn)(name, id, salary, amount)
orders(level, salary, id, type)
Task: Retrieve amount from transactions whose status is found in orders rows where level matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13172 | train |
v3 | Schema:
categories (alias: catg)(status, id, level, date)
branches(name, amount, type, level)
Task: Retrieve amount from categories with salary above the MIN(value) of branches rows sharing the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13173 | train |
v1 | Schema:
invoices (alias: inv)(id, type, name, date)
projects(id, date, name, salary)
Task: Retrieve salary from invoices whose code is found in projects rows where status matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13174 | train |
v1 | Schema:
managers (alias: mgr)(status, date, salary, value)
employees(salary, status, id, level)
Task: Select id from managers where type exists in employees for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13175 | train |
v1 | Schema:
departments (alias: dept)(date, status, salary, name)
staff(level, id, value, salary)
Task: Retrieve id from departments whose code is found in staff rows where code matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13176 | train |
v2 | Schema:
orders (alias: ord)(level, salary, name, type)
categories(name, id, type, status)
Task: Retrieve value from orders that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13177 | train |
v1 | Schema:
sales (alias: sale)(status, name, level, type)
transactions(level, date, value, code)
Task: Select value from sales where id exists in transactions for the same level.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13178 | train |
v3 | Schema:
schedules (alias: schd)(salary, date, value, type)
departments(salary, date, type, name)
Task: Find value from schedules where value exceeds the total salary from departments for the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT SUM(salary) FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13179 | train |
v1 | Schema:
branches (alias: brc)(name, value, code, id)
requests(status, code, salary, value)
Task: Retrieve code from branches whose id is found in requests rows where code matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13180 | train |
v3 | Schema:
orders (alias: ord)(date, status, id, code)
branches(status, amount, type, id)
Task: Find name from orders where salary exceeds the count of salary from branches for the same status.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13181 | train |
v2 | Schema:
orders (alias: ord)(value, name, level, status)
projects(date, amount, value, salary)
Task: Find code from orders where a matching record exists in projects with the same status.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13182 | train |
v3 | Schema:
categories (alias: catg)(status, value, salary, type)
branches(amount, code, level, value)
Task: Find name from categories where salary exceeds the total amount from branches for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13183 | train |
v3 | Schema:
branches (alias: brc)(value, level, date, amount)
managers(value, type, level, id)
Task: Find name from branches where amount exceeds the total value from managers for the same id.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_13184 | train |
v2 | Schema:
tasks (alias: tsk)(date, type, level, code)
departments(id, status, date, code)
Task: Find code from tasks where a matching record exists in departments with the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13185 | train |
v2 | Schema:
items (alias: lne)(date, salary, id, type)
sales(name, type, status, code)
Task: Retrieve id from items that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = lne.status
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13186 | train |
v1 | Schema:
items (alias: lne)(code, name, amount, date)
branches(status, level, id, amount)
Task: Select salary from items where status exists in branches for the same status.
SQL: | SELECT salary FROM items AS lne
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.status = lne.status
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_13187 | train |
v2 | Schema:
projects (alias: prj)(amount, date, id, value)
products(salary, status, code, level)
Task: Retrieve value from projects that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13188 | train |
v1 | Schema:
orders (alias: ord)(level, value, amount, date)
invoices(code, date, name, value)
Task: Find code from orders where code appears in invoices entries with matching id.
SQL: | SELECT code FROM orders AS ord
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13189 | train |
v3 | Schema:
tasks (alias: tsk)(date, level, name, amount)
shipments(level, date, status, type)
Task: Find value from tasks where salary exceeds the total value from shipments for the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_13190 | train |
v1 | Schema:
departments (alias: dept)(status, code, id, date)
categories(name, date, level, amount)
Task: Select amount from departments where level exists in categories for the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13191 | train |
v2 | Schema:
invoices (alias: inv)(code, type, name, id)
managers(name, date, salary, code)
Task: Retrieve name from invoices that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13192 | train |
v1 | Schema:
categories (alias: catg)(type, level, salary, name)
staff(code, level, id, date)
Task: Select salary from categories where id exists in staff for the same id.
SQL: | SELECT salary FROM categories AS catg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_13193 | train |
v3 | Schema:
managers (alias: mgr)(salary, amount, code, id)
staff(code, salary, status, amount)
Task: Find name from managers where salary exceeds the count of amount from staff for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13194 | train |
v2 | Schema:
requests (alias: ordr)(status, id, level, code)
invoices(name, code, date, status)
Task: Find code from requests where a matching record exists in invoices with the same type.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13195 | train |
v2 | Schema:
customers (alias: cust)(status, type, amount, date)
transactions(status, date, value, id)
Task: Retrieve id from customers that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_13196 | train |
v2 | Schema:
requests (alias: ordr)(name, id, type, value)
orders(level, value, date, id)
Task: Find amount from requests where a matching record exists in orders with the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_13197 | train |
v1 | Schema:
projects (alias: prj)(name, id, code, value)
schedules(name, value, code, salary)
Task: Select code from projects where level exists in schedules for the same level.
SQL: | SELECT code FROM projects AS prj
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_13198 | train |
v1 | Schema:
regions (alias: rgn)(id, salary, type, code)
invoices(status, salary, date, type)
Task: Retrieve id from regions whose id is found in invoices rows where id matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_13199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.