variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
requests (alias: ordr)(status, date, type, code)
categories(status, id, salary, amount)
Task: Select salary from requests where status exists in categories for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10800 | train |
v3 | Schema:
orders (alias: ord)(type, name, amount, level)
customers(level, name, code, type)
Task: Find name from orders where salary exceeds the total value from customers for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10801 | train |
v3 | Schema:
projects (alias: prj)(salary, code, date, value)
requests(value, amount, salary, id)
Task: Find id from projects where amount exceeds the count of salary from requests for the same code.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10802 | train |
v2 | Schema:
employees (alias: emp)(salary, id, type, value)
orders(level, name, id, status)
Task: Retrieve id from employees that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10803 | train |
v3 | Schema:
regions (alias: rgn)(status, level, id, salary)
items(level, name, code, salary)
Task: Retrieve id from regions with salary above the AVG(amount) of items rows sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10804 | train |
v1 | Schema:
branches (alias: brc)(code, amount, id, value)
regions(value, code, id, name)
Task: Find name from branches where status appears in regions entries with matching id.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status 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": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10805 | train |
v3 | Schema:
items (alias: lne)(name, amount, value, status)
requests(date, name, level, code)
Task: Find amount from items where value exceeds the total salary from requests for the same id.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10806 | train |
v3 | Schema:
requests (alias: ordr)(type, level, amount, value)
accounts(salary, code, id, level)
Task: Retrieve salary from requests with value above the MAX(value) of accounts rows sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE value > (
SELECT MAX(value) FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10807 | train |
v1 | Schema:
departments (alias: dept)(date, amount, type, id)
orders(status, amount, code, salary)
Task: Find code from departments where status appears in orders entries with matching id.
SQL: | SELECT code FROM departments AS dept
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10808 | train |
v1 | Schema:
items (alias: lne)(type, value, amount, status)
categories(level, type, date, value)
Task: Retrieve salary from items whose code is found in categories rows where status matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10809 | train |
v2 | Schema:
shipments (alias: shp)(code, level, type, salary)
invoices(code, level, salary, id)
Task: Retrieve salary from shipments that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10810 | train |
v1 | Schema:
transactions (alias: txn)(date, level, value, type)
items(name, status, salary, amount)
Task: Find id from transactions where code appears in items entries with matching type.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10811 | train |
v2 | Schema:
schedules (alias: schd)(status, date, code, id)
tasks(salary, type, id, code)
Task: Retrieve code from schedules that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10812 | train |
v3 | Schema:
tasks (alias: tsk)(id, type, value, salary)
departments(code, status, id, salary)
Task: Find value from tasks where amount exceeds the maximum amount from departments for the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10813 | train |
v1 | Schema:
schedules (alias: schd)(amount, level, type, name)
shipments(id, date, code, level)
Task: Find name from schedules where id appears in shipments entries with matching id.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10814 | train |
v1 | Schema:
products (alias: prod)(level, date, amount, code)
items(salary, date, type, name)
Task: Retrieve id from products whose status is found in items rows where type matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10815 | train |
v2 | Schema:
orders (alias: ord)(value, type, name, salary)
departments(amount, date, type, code)
Task: Find name from orders where a matching record exists in departments with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10816 | train |
v2 | Schema:
transactions (alias: txn)(date, salary, id, status)
items(date, id, status, level)
Task: Retrieve amount from transactions that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10817 | train |
v1 | Schema:
employees (alias: emp)(salary, id, amount, value)
tasks(status, code, name, amount)
Task: Retrieve salary from employees whose status is found in tasks rows where code matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status 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": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10818 | train |
v2 | Schema:
employees (alias: emp)(code, salary, status, level)
branches(date, salary, id, status)
Task: Find value from employees where a matching record exists in branches with the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10819 | train |
v2 | Schema:
schedules (alias: schd)(status, amount, type, level)
customers(value, name, status, salary)
Task: Retrieve id from schedules that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10820 | train |
v3 | Schema:
departments (alias: dept)(amount, name, type, level)
tasks(code, date, name, salary)
Task: Find salary from departments where salary exceeds the count of salary from tasks for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE salary > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10821 | train |
v1 | Schema:
items (alias: lne)(salary, amount, date, code)
transactions(status, date, id, value)
Task: Select amount from items where code exists in transactions for the same id.
SQL: | SELECT amount FROM items AS lne
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = lne.id
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10822 | train |
v2 | Schema:
staff (alias: empl)(salary, name, id, amount)
invoices(name, salary, code, type)
Task: Find code from staff where a matching record exists in invoices with the same type.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10823 | train |
v2 | Schema:
items (alias: lne)(id, salary, status, value)
accounts(level, value, amount, name)
Task: Find name from items where a matching record exists in accounts with the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = lne.code
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10824 | train |
v3 | Schema:
sales (alias: sale)(salary, level, amount, date)
managers(amount, status, salary, value)
Task: Find amount from sales where salary exceeds the count of value from managers for the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM managers AS mgr
WHERE mgr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10825 | train |
v1 | Schema:
products (alias: prod)(amount, id, salary, date)
branches(level, id, amount, date)
Task: Find id from products where type appears in branches entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = prod.code
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10826 | train |
v2 | Schema:
items (alias: lne)(level, type, code, amount)
departments(amount, type, date, salary)
Task: Retrieve name from items that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = lne.type
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10827 | train |
v3 | Schema:
projects (alias: prj)(amount, name, value, status)
requests(code, date, status, salary)
Task: Find salary from projects where amount exceeds the average amount from requests for the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "salary",
"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_10828 | train |
v2 | Schema:
sales (alias: sale)(date, amount, level, status)
invoices(level, id, name, code)
Task: Retrieve id from sales that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10829 | train |
v3 | Schema:
orders (alias: ord)(name, date, level, salary)
departments(id, level, amount, status)
Task: Retrieve salary from orders with salary above the AVG(salary) of departments rows sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10830 | train |
v2 | Schema:
customers (alias: cust)(code, status, amount, id)
projects(amount, name, date, code)
Task: Find salary from customers where a matching record exists in projects with the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10831 | train |
v1 | Schema:
managers (alias: mgr)(status, date, id, salary)
customers(salary, name, level, code)
Task: Select value from managers where type exists in customers for the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10832 | train |
v2 | Schema:
managers (alias: mgr)(name, level, amount, type)
schedules(code, type, value, date)
Task: Retrieve salary from managers that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10833 | train |
v2 | Schema:
transactions (alias: txn)(date, name, salary, amount)
invoices(date, salary, value, type)
Task: Retrieve amount from transactions that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10834 | train |
v3 | Schema:
sales (alias: sale)(level, status, date, amount)
shipments(amount, level, id, status)
Task: Find code from sales where salary exceeds the count of salary from shipments for the same level.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10835 | train |
v3 | Schema:
departments (alias: dept)(id, type, name, date)
orders(salary, value, code, id)
Task: Find name from departments where salary exceeds the maximum amount from orders for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10836 | train |
v2 | Schema:
sales (alias: sale)(salary, date, id, name)
schedules(level, type, code, amount)
Task: Find name from sales where a matching record exists in schedules with the same type.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10837 | train |
v3 | Schema:
transactions (alias: txn)(code, level, date, status)
customers(id, salary, status, type)
Task: Find name from transactions where amount exceeds the count of value from customers for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10838 | train |
v1 | Schema:
departments (alias: dept)(name, value, status, type)
customers(name, salary, amount, level)
Task: Find amount from departments where type appears in customers entries with matching level.
SQL: | SELECT amount FROM departments AS dept
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10839 | train |
v2 | Schema:
orders (alias: ord)(date, salary, id, status)
staff(value, code, type, status)
Task: Retrieve id from orders that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10840 | train |
v2 | Schema:
staff (alias: empl)(name, level, id, date)
products(salary, status, id, level)
Task: Retrieve code from staff that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10841 | train |
v3 | Schema:
customers (alias: cust)(status, value, amount, date)
shipments(code, amount, level, value)
Task: Retrieve code from customers with value above the AVG(salary) of shipments rows sharing the same id.
SQL: | SELECT code FROM customers AS cust
WHERE value > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10842 | train |
v1 | Schema:
projects (alias: prj)(name, status, value, level)
items(value, amount, status, salary)
Task: Find amount from projects where code appears in items entries with matching id.
SQL: | SELECT amount FROM projects AS prj
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10843 | train |
v1 | Schema:
regions (alias: rgn)(status, amount, id, value)
sales(id, level, value, type)
Task: Select salary from regions where code exists in sales for the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10844 | train |
v2 | Schema:
customers (alias: cust)(value, status, date, id)
schedules(salary, value, status, amount)
Task: Retrieve id from customers that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10845 | train |
v1 | Schema:
tasks (alias: tsk)(type, status, code, amount)
employees(value, salary, code, name)
Task: Select amount from tasks where type exists in employees for the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10846 | train |
v3 | Schema:
regions (alias: rgn)(id, date, type, level)
schedules(code, name, type, status)
Task: Find id from regions where salary exceeds the count of value from schedules for the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT COUNT(value) FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10847 | train |
v3 | Schema:
products (alias: prod)(level, name, status, code)
requests(date, value, id, type)
Task: Retrieve amount from products with amount above the AVG(value) of requests rows sharing the same type.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10848 | train |
v3 | Schema:
accounts (alias: acct)(id, salary, value, code)
products(date, name, code, salary)
Task: Retrieve salary from accounts with value above the MIN(amount) of products rows sharing the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE value > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10849 | train |
v1 | Schema:
accounts (alias: acct)(type, code, amount, salary)
products(type, amount, value, name)
Task: Find value from accounts where id appears in products entries with matching code.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10850 | train |
v1 | Schema:
products (alias: prod)(amount, date, value, salary)
branches(salary, name, level, status)
Task: Select amount from products where code exists in branches for the same status.
SQL: | SELECT amount FROM products AS prod
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.status = prod.status
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10851 | train |
v2 | Schema:
managers (alias: mgr)(name, level, amount, status)
shipments(code, salary, amount, type)
Task: Retrieve id from managers that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10852 | train |
v2 | Schema:
transactions (alias: txn)(salary, id, name, code)
departments(amount, date, id, value)
Task: Retrieve code from transactions that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10853 | train |
v2 | Schema:
regions (alias: rgn)(date, status, salary, name)
sales(type, date, id, level)
Task: Find salary from regions where a matching record exists in sales with the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10854 | train |
v1 | Schema:
tasks (alias: tsk)(name, type, status, amount)
orders(code, salary, status, id)
Task: Retrieve value from tasks whose level is found in orders rows where level matches the outer record.
SQL: | SELECT value FROM tasks AS tsk
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10855 | train |
v1 | Schema:
tasks (alias: tsk)(id, type, name, level)
orders(type, amount, salary, status)
Task: Select name from tasks where status exists in orders for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10856 | train |
v2 | Schema:
transactions (alias: txn)(amount, type, code, date)
shipments(name, level, code, id)
Task: Find id from transactions where a matching record exists in shipments with the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10857 | train |
v1 | Schema:
departments (alias: dept)(code, value, salary, type)
items(level, amount, name, date)
Task: Find id from departments where level appears in items entries with matching id.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10858 | train |
v1 | Schema:
departments (alias: dept)(date, code, salary, id)
employees(date, amount, value, code)
Task: Retrieve id from departments whose id is found in employees rows where type matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10859 | train |
v3 | Schema:
regions (alias: rgn)(name, type, salary, amount)
sales(date, value, amount, level)
Task: Retrieve name from regions with amount above the AVG(value) of sales rows sharing the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10860 | train |
v3 | Schema:
orders (alias: ord)(date, amount, code, type)
categories(value, date, salary, amount)
Task: Find salary from orders where amount exceeds the total amount from categories for the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10861 | train |
v2 | Schema:
departments (alias: dept)(type, level, id, amount)
schedules(code, date, amount, salary)
Task: Find value from departments where a matching record exists in schedules with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10862 | train |
v1 | Schema:
departments (alias: dept)(value, name, code, salary)
tasks(amount, status, id, salary)
Task: Retrieve id from departments whose code is found in tasks rows where level matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10863 | train |
v2 | Schema:
departments (alias: dept)(salary, value, level, amount)
managers(type, amount, id, value)
Task: Retrieve salary from departments that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10864 | train |
v3 | Schema:
managers (alias: mgr)(amount, code, type, status)
customers(name, code, status, salary)
Task: Find code from managers where amount exceeds the average salary from customers for the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT AVG(salary) 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": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10865 | train |
v3 | Schema:
shipments (alias: shp)(name, status, amount, date)
customers(level, code, date, value)
Task: Retrieve name from shipments with value above the COUNT(value) of customers rows sharing the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM customers AS cust
WHERE cust.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10866 | train |
v2 | Schema:
sales (alias: sale)(type, value, code, level)
projects(salary, type, name, level)
Task: Retrieve salary from sales that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10867 | train |
v1 | Schema:
items (alias: lne)(value, code, id, date)
branches(value, id, date, amount)
Task: Retrieve id from items whose code is found in branches rows where level matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = lne.level
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10868 | train |
v2 | Schema:
branches (alias: brc)(date, code, id, name)
requests(date, amount, id, type)
Task: Retrieve salary from branches that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10869 | train |
v3 | Schema:
products (alias: prod)(type, level, name, amount)
schedules(name, id, value, level)
Task: Retrieve salary from products with value above the COUNT(salary) of schedules rows sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10870 | train |
v3 | Schema:
products (alias: prod)(salary, id, code, value)
categories(type, status, id, code)
Task: Find salary from products where salary exceeds the count of salary from categories for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10871 | train |
v3 | Schema:
items (alias: lne)(value, id, date, type)
staff(salary, name, date, code)
Task: Find id from items where amount exceeds the average value from staff for the same type.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.type = lne.type
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10872 | train |
v1 | Schema:
employees (alias: emp)(type, status, id, code)
staff(code, value, status, level)
Task: Select name from employees where code exists in staff for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10873 | train |
v2 | Schema:
staff (alias: empl)(code, value, status, level)
items(salary, name, date, id)
Task: Find value from staff where a matching record exists in items with the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10874 | train |
v2 | Schema:
customers (alias: cust)(code, name, value, amount)
branches(id, type, salary, status)
Task: Retrieve name from customers that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10875 | train |
v2 | Schema:
projects (alias: prj)(status, level, amount, type)
invoices(value, date, salary, name)
Task: Retrieve salary from projects that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10876 | train |
v1 | Schema:
departments (alias: dept)(salary, code, status, name)
regions(code, name, level, type)
Task: Select id from departments where level exists in regions for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10877 | train |
v1 | Schema:
requests (alias: ordr)(code, date, type, value)
transactions(code, type, date, level)
Task: Find name from requests where level appears in transactions entries with matching type.
SQL: | SELECT name FROM requests AS ordr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10878 | train |
v3 | Schema:
customers (alias: cust)(name, value, id, code)
accounts(date, status, id, amount)
Task: Find code from customers where amount exceeds the total salary from accounts for the same level.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10879 | train |
v1 | Schema:
customers (alias: cust)(amount, code, salary, value)
employees(status, id, value, level)
Task: Select id from customers where code exists in employees for the same status.
SQL: | SELECT id FROM customers AS cust
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10880 | train |
v3 | Schema:
branches (alias: brc)(salary, amount, status, level)
sales(date, status, salary, name)
Task: Retrieve value from branches with amount above the MAX(salary) of sales rows sharing the same id.
SQL: | SELECT value FROM branches AS brc
WHERE amount > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10881 | train |
v2 | Schema:
staff (alias: empl)(name, type, date, value)
invoices(name, id, status, salary)
Task: Find id from staff where a matching record exists in invoices with the same level.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10882 | train |
v1 | Schema:
tasks (alias: tsk)(level, status, name, code)
customers(type, status, date, salary)
Task: Retrieve salary from tasks whose type is found in customers rows where type matches the outer record.
SQL: | SELECT salary FROM tasks AS tsk
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10883 | train |
v2 | Schema:
shipments (alias: shp)(name, status, value, level)
accounts(level, code, status, amount)
Task: Find name from shipments where a matching record exists in accounts with the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10884 | train |
v3 | Schema:
staff (alias: empl)(date, value, amount, type)
customers(type, level, salary, amount)
Task: Retrieve code from staff with amount above the AVG(salary) of customers rows sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10885 | train |
v2 | Schema:
requests (alias: ordr)(value, salary, level, code)
managers(date, status, salary, id)
Task: Retrieve value from requests that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10886 | train |
v1 | Schema:
managers (alias: mgr)(type, value, amount, status)
projects(value, status, level, code)
Task: Find amount from managers where code appears in projects entries with matching code.
SQL: | SELECT amount FROM managers AS mgr
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10887 | train |
v3 | Schema:
customers (alias: cust)(code, name, id, amount)
schedules(id, name, type, salary)
Task: Retrieve code from customers with amount above the SUM(amount) of schedules rows sharing the same code.
SQL: | SELECT code FROM customers AS cust
WHERE amount > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10888 | train |
v3 | Schema:
accounts (alias: acct)(type, level, id, date)
employees(salary, amount, value, type)
Task: Find name from accounts where value exceeds the total value from employees for the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10889 | train |
v2 | Schema:
schedules (alias: schd)(code, id, salary, status)
categories(id, name, date, level)
Task: Find name from schedules where a matching record exists in categories with the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10890 | train |
v2 | Schema:
departments (alias: dept)(name, type, level, status)
transactions(date, salary, type, amount)
Task: Find value from departments where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10891 | train |
v3 | Schema:
staff (alias: empl)(amount, status, date, name)
projects(value, date, salary, level)
Task: Find amount from staff where amount exceeds the total amount from projects for the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10892 | train |
v1 | Schema:
categories (alias: catg)(status, amount, name, id)
managers(level, name, id, code)
Task: Find value from categories where id appears in managers entries with matching id.
SQL: | SELECT value FROM categories AS catg
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10893 | train |
v2 | Schema:
employees (alias: emp)(value, type, date, salary)
managers(type, amount, salary, value)
Task: Retrieve id from employees that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10894 | train |
v2 | Schema:
managers (alias: mgr)(salary, level, id, type)
tasks(name, amount, status, date)
Task: Find value from managers where a matching record exists in tasks with the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10895 | train |
v3 | Schema:
orders (alias: ord)(amount, salary, date, value)
managers(status, code, name, id)
Task: Find value from orders where salary exceeds the maximum value from managers for the same status.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10896 | train |
v3 | Schema:
managers (alias: mgr)(amount, level, id, date)
transactions(status, date, level, value)
Task: Find id from managers where salary exceeds the total amount from transactions for the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10897 | train |
v2 | Schema:
requests (alias: ordr)(status, name, code, amount)
products(salary, id, level, status)
Task: Retrieve name from requests that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10898 | train |
v3 | Schema:
sales (alias: sale)(amount, value, date, code)
invoices(amount, date, status, name)
Task: Find amount from sales where value exceeds the count of value from invoices for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10899 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.