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:
customers (alias: cust)(date, id, type, name)
accounts(name, code, level, type)
Task: Retrieve amount from customers whose level is found in accounts rows where level matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07600 | train |
v1 | Schema:
orders (alias: ord)(code, value, type, id)
employees(id, salary, status, name)
Task: Retrieve name from orders whose level is found in employees rows where id matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07601 | train |
v2 | Schema:
regions (alias: rgn)(level, name, type, salary)
requests(type, value, date, amount)
Task: Find salary from regions where a matching record exists in requests with the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07602 | train |
v2 | Schema:
managers (alias: mgr)(name, code, value, date)
requests(status, type, date, value)
Task: Find amount from managers where a matching record exists in requests with the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07603 | train |
v2 | Schema:
staff (alias: empl)(status, level, salary, code)
customers(status, date, level, type)
Task: Find amount from staff where a matching record exists in customers with the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07604 | train |
v1 | Schema:
regions (alias: rgn)(amount, value, name, date)
customers(status, amount, type, value)
Task: Select value from regions where type exists in customers for the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07605 | train |
v1 | Schema:
transactions (alias: txn)(date, id, status, level)
sales(id, value, amount, date)
Task: Find name from transactions where status appears in sales entries with matching id.
SQL: | SELECT name FROM transactions AS txn
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07606 | train |
v2 | Schema:
projects (alias: prj)(date, level, code, type)
invoices(id, salary, status, type)
Task: Retrieve value from projects that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07607 | train |
v2 | Schema:
requests (alias: ordr)(value, amount, type, date)
departments(type, salary, level, amount)
Task: Retrieve name from requests that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07608 | train |
v1 | Schema:
sales (alias: sale)(date, id, amount, name)
tasks(amount, name, value, status)
Task: Find code from sales where type appears in tasks entries with matching status.
SQL: | SELECT code FROM sales AS sale
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07609 | train |
v3 | Schema:
employees (alias: emp)(status, id, type, salary)
shipments(value, name, code, status)
Task: Find value from employees where salary exceeds the total amount from shipments for the same code.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07610 | train |
v2 | Schema:
customers (alias: cust)(level, amount, status, id)
products(type, salary, level, value)
Task: Retrieve name from customers that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07611 | train |
v2 | Schema:
transactions (alias: txn)(level, date, type, id)
tasks(value, level, id, amount)
Task: Retrieve salary from transactions that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07612 | train |
v2 | Schema:
projects (alias: prj)(value, status, level, date)
transactions(level, id, amount, value)
Task: Retrieve id from projects that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07613 | train |
v2 | Schema:
invoices (alias: inv)(status, type, date, name)
projects(id, amount, salary, value)
Task: Find id from invoices where a matching record exists in projects with the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07614 | train |
v2 | Schema:
orders (alias: ord)(name, value, id, salary)
staff(type, status, id, level)
Task: Find name from orders where a matching record exists in staff with the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07615 | train |
v1 | Schema:
customers (alias: cust)(id, amount, status, value)
products(amount, name, status, date)
Task: Select salary from customers where id exists in products for the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07616 | train |
v1 | Schema:
invoices (alias: inv)(status, amount, name, date)
managers(code, salary, id, status)
Task: Retrieve salary from invoices whose level is found in managers rows where id matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07617 | train |
v1 | Schema:
products (alias: prod)(code, id, salary, level)
customers(salary, value, id, type)
Task: Select salary from products where type exists in customers for the same id.
SQL: | SELECT salary FROM products AS prod
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.id = prod.id
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07618 | train |
v3 | Schema:
staff (alias: empl)(id, value, type, status)
managers(code, id, date, level)
Task: Retrieve amount from staff with value above the MIN(salary) of managers rows sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07619 | train |
v1 | Schema:
requests (alias: ordr)(date, value, status, type)
products(status, code, date, amount)
Task: Find name from requests where code appears in products entries with matching id.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07620 | train |
v3 | Schema:
accounts (alias: acct)(date, salary, amount, name)
branches(name, amount, type, value)
Task: Retrieve id from accounts with amount above the MAX(value) of branches rows sharing the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE amount > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07621 | train |
v3 | Schema:
employees (alias: emp)(value, amount, code, salary)
projects(level, amount, code, type)
Task: Find code from employees where amount exceeds the maximum salary from projects for the same code.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07622 | train |
v1 | Schema:
orders (alias: ord)(amount, salary, type, code)
regions(name, value, salary, status)
Task: Select value from orders where code exists in regions for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07623 | train |
v2 | Schema:
transactions (alias: txn)(id, level, salary, amount)
sales(value, code, date, type)
Task: Find value from transactions where a matching record exists in sales with the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07624 | train |
v2 | Schema:
transactions (alias: txn)(date, type, amount, value)
regions(name, salary, date, code)
Task: Find value from transactions where a matching record exists in regions with the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07625 | train |
v2 | Schema:
tasks (alias: tsk)(level, salary, value, type)
invoices(code, value, date, type)
Task: Retrieve amount from tasks that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07626 | train |
v3 | Schema:
items (alias: lne)(id, status, type, date)
tasks(value, status, id, type)
Task: Find amount from items where salary exceeds the count of salary from tasks for the same code.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07627 | train |
v1 | Schema:
employees (alias: emp)(type, id, value, salary)
requests(type, salary, amount, status)
Task: Select id from employees where code exists in requests for the same id.
SQL: | SELECT id FROM employees AS emp
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07628 | train |
v1 | Schema:
sales (alias: sale)(status, date, type, level)
invoices(status, name, type, level)
Task: Retrieve name from sales whose type is found in invoices rows where status matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07629 | train |
v2 | Schema:
tasks (alias: tsk)(status, level, value, id)
invoices(salary, status, value, code)
Task: Find amount from tasks where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07630 | train |
v3 | Schema:
sales (alias: sale)(type, id, amount, level)
staff(salary, level, date, value)
Task: Retrieve amount from sales with amount above the MIN(salary) of staff rows sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07631 | train |
v3 | Schema:
transactions (alias: txn)(value, level, status, amount)
categories(status, name, amount, date)
Task: Find name from transactions where salary exceeds the total salary from categories for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07632 | train |
v3 | Schema:
sales (alias: sale)(id, name, value, salary)
customers(id, status, value, amount)
Task: Retrieve id from sales with value above the MAX(amount) of customers rows sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07633 | train |
v1 | Schema:
tasks (alias: tsk)(level, name, type, value)
managers(date, name, type, salary)
Task: Find value from tasks where id appears in managers entries with matching type.
SQL: | SELECT value FROM tasks AS tsk
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07634 | train |
v2 | Schema:
employees (alias: emp)(type, code, status, name)
requests(amount, salary, level, status)
Task: Retrieve value from employees that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07635 | train |
v1 | Schema:
transactions (alias: txn)(value, status, amount, id)
managers(value, status, name, code)
Task: Select name from transactions where code exists in managers for the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07636 | train |
v2 | Schema:
regions (alias: rgn)(type, name, date, amount)
orders(code, amount, id, type)
Task: Find amount from regions where a matching record exists in orders with the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07637 | train |
v2 | Schema:
shipments (alias: shp)(amount, id, code, level)
projects(type, salary, id, value)
Task: Retrieve code from shipments that have at least one corresponding entry in projects sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07638 | train |
v1 | Schema:
employees (alias: emp)(id, level, salary, code)
items(name, status, value, level)
Task: Select amount from employees where level exists in items for the same level.
SQL: | SELECT amount FROM employees AS emp
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07639 | train |
v1 | Schema:
sales (alias: sale)(id, type, level, code)
regions(code, type, name, salary)
Task: Find amount from sales where id appears in regions entries with matching type.
SQL: | SELECT amount FROM sales AS sale
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07640 | train |
v3 | Schema:
transactions (alias: txn)(salary, code, status, type)
regions(status, code, date, id)
Task: Retrieve salary from transactions with value above the COUNT(salary) of regions rows sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07641 | train |
v2 | Schema:
staff (alias: empl)(amount, name, type, salary)
invoices(amount, value, status, level)
Task: Retrieve id from staff that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07642 | train |
v3 | Schema:
branches (alias: brc)(value, name, id, date)
items(status, type, code, value)
Task: Find name from branches where salary exceeds the count of amount from items for the same code.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07643 | train |
v1 | Schema:
schedules (alias: schd)(type, level, name, status)
products(level, id, amount, date)
Task: Select salary from schedules where status exists in products for the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07644 | train |
v3 | Schema:
customers (alias: cust)(date, name, status, amount)
schedules(status, code, type, name)
Task: Find value from customers where amount exceeds the total value from schedules for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07645 | train |
v2 | Schema:
shipments (alias: shp)(status, amount, type, value)
sales(salary, status, name, type)
Task: Retrieve value from shipments that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07646 | train |
v1 | Schema:
projects (alias: prj)(code, status, type, date)
staff(status, name, salary, id)
Task: Retrieve amount from projects whose status is found in staff rows where status matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07647 | train |
v1 | Schema:
invoices (alias: inv)(name, type, date, amount)
tasks(id, name, level, date)
Task: Retrieve name from invoices whose status is found in tasks rows where level matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07648 | train |
v3 | Schema:
sales (alias: sale)(type, date, code, level)
employees(salary, code, status, level)
Task: Find amount from sales where amount exceeds the count of salary from employees for the same level.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07649 | train |
v3 | Schema:
sales (alias: sale)(status, level, code, value)
schedules(date, level, salary, id)
Task: Retrieve id from sales with value above the COUNT(salary) of schedules rows sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT COUNT(salary) FROM schedules AS schd
WHERE schd.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07650 | train |
v3 | Schema:
items (alias: lne)(level, date, value, name)
tasks(date, salary, type, id)
Task: Retrieve salary from items with amount above the MIN(salary) of tasks rows sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.status = lne.status
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07651 | train |
v1 | Schema:
customers (alias: cust)(code, salary, value, name)
invoices(name, level, code, value)
Task: Select amount from customers where code exists in invoices for the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07652 | train |
v3 | Schema:
departments (alias: dept)(name, salary, amount, id)
items(level, id, value, salary)
Task: Retrieve id from departments with value above the SUM(value) of items rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT SUM(value) 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": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07653 | train |
v2 | Schema:
sales (alias: sale)(code, id, amount, type)
regions(id, code, status, amount)
Task: Retrieve salary from sales that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07654 | train |
v1 | Schema:
categories (alias: catg)(status, type, amount, salary)
branches(salary, name, code, level)
Task: Select amount from categories where type exists in branches for the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07655 | train |
v1 | Schema:
staff (alias: empl)(level, type, id, amount)
accounts(name, id, code, date)
Task: Select id from staff where code exists in accounts for the same level.
SQL: | SELECT id FROM staff AS empl
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07656 | train |
v1 | Schema:
regions (alias: rgn)(name, type, amount, value)
branches(id, level, date, value)
Task: Select id from regions where type exists in branches for the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07657 | train |
v2 | Schema:
customers (alias: cust)(status, type, amount, level)
requests(id, name, level, date)
Task: Find id from customers where a matching record exists in requests with the same code.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07658 | train |
v2 | Schema:
customers (alias: cust)(name, status, salary, value)
employees(date, salary, amount, level)
Task: Retrieve code from customers that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07659 | train |
v1 | Schema:
staff (alias: empl)(level, type, id, name)
requests(id, salary, level, status)
Task: Retrieve id from staff whose status is found in requests rows where type matches the outer record.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07660 | train |
v1 | Schema:
schedules (alias: schd)(status, date, type, amount)
managers(name, amount, date, salary)
Task: Retrieve name from schedules whose status is found in managers rows where status matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07661 | train |
v3 | Schema:
sales (alias: sale)(type, level, id, code)
employees(date, type, salary, id)
Task: Find code from sales where salary exceeds the maximum salary from employees for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07662 | train |
v3 | Schema:
shipments (alias: shp)(status, value, amount, id)
schedules(status, code, level, type)
Task: Retrieve id from shipments with salary above the AVG(value) of schedules rows sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07663 | train |
v2 | Schema:
schedules (alias: schd)(status, value, type, code)
staff(type, value, date, status)
Task: Find code from schedules where a matching record exists in staff with the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07664 | train |
v3 | Schema:
customers (alias: cust)(code, value, type, level)
items(name, level, date, code)
Task: Find name from customers where value exceeds the count of amount from items for the same type.
SQL: | SELECT name FROM customers AS cust
WHERE value > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07665 | train |
v1 | Schema:
accounts (alias: acct)(value, type, name, code)
sales(salary, code, date, amount)
Task: Select id from accounts where type exists in sales for the same id.
SQL: | SELECT id FROM accounts AS acct
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07666 | train |
v3 | Schema:
orders (alias: ord)(date, name, code, status)
products(code, level, amount, value)
Task: Retrieve amount from orders with amount above the MIN(amount) of products rows sharing the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT MIN(amount) FROM products AS prod
WHERE prod.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07667 | train |
v3 | Schema:
regions (alias: rgn)(amount, name, value, id)
projects(value, id, amount, name)
Task: Retrieve code from regions with value above the MIN(value) of projects rows sharing the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07668 | train |
v1 | Schema:
requests (alias: ordr)(status, amount, level, value)
orders(status, code, type, level)
Task: Retrieve code from requests whose id is found in orders rows where status matches the outer record.
SQL: | SELECT code 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": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07669 | train |
v1 | Schema:
invoices (alias: inv)(name, type, status, date)
sales(salary, type, date, id)
Task: Find salary from invoices where code appears in sales entries with matching level.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07670 | train |
v1 | Schema:
sales (alias: sale)(status, code, name, amount)
staff(name, value, id, salary)
Task: Select value from sales where type exists in staff for the same code.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07671 | train |
v3 | Schema:
categories (alias: catg)(value, level, status, id)
items(id, status, salary, level)
Task: Retrieve salary from categories with amount above the SUM(salary) of items rows sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07672 | train |
v3 | Schema:
regions (alias: rgn)(amount, value, id, salary)
tasks(date, salary, amount, name)
Task: Retrieve value from regions with value above the MIN(value) of tasks rows sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT MIN(value) FROM tasks AS tsk
WHERE tsk.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07673 | train |
v2 | Schema:
schedules (alias: schd)(date, name, status, salary)
shipments(date, amount, code, salary)
Task: Retrieve amount from schedules that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07674 | train |
v3 | Schema:
products (alias: prod)(value, level, status, code)
customers(amount, level, name, code)
Task: Retrieve id from products with amount above the MAX(salary) of customers rows sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.type = prod.type
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07675 | train |
v2 | Schema:
branches (alias: brc)(code, date, amount, name)
customers(amount, type, status, id)
Task: Retrieve value from branches that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07676 | train |
v1 | Schema:
employees (alias: emp)(date, name, status, type)
categories(value, type, id, date)
Task: Select code from employees where type exists in categories for the same type.
SQL: | SELECT code FROM employees AS emp
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07677 | train |
v3 | Schema:
departments (alias: dept)(code, value, status, name)
branches(date, name, salary, amount)
Task: Retrieve value from departments with value above the MAX(value) of branches rows sharing the same id.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07678 | train |
v1 | Schema:
schedules (alias: schd)(date, status, code, amount)
regions(value, status, type, date)
Task: Find amount from schedules where id appears in regions entries with matching status.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07679 | train |
v2 | Schema:
customers (alias: cust)(date, amount, status, level)
branches(id, name, status, level)
Task: Find value from customers where a matching record exists in branches with the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07680 | train |
v1 | Schema:
projects (alias: prj)(salary, id, date, code)
transactions(salary, status, id, amount)
Task: Retrieve id from projects whose id is found in transactions rows where level matches the outer record.
SQL: | SELECT id FROM projects AS prj
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07681 | train |
v1 | Schema:
tasks (alias: tsk)(name, code, salary, level)
products(code, salary, name, id)
Task: Find id from tasks where code appears in products entries with matching level.
SQL: | SELECT id FROM tasks AS tsk
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07682 | train |
v1 | Schema:
invoices (alias: inv)(amount, code, level, type)
schedules(status, type, id, level)
Task: Select salary from invoices where code exists in schedules for the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07683 | train |
v2 | Schema:
employees (alias: emp)(code, status, amount, type)
items(name, id, amount, code)
Task: Retrieve code from employees that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07684 | train |
v2 | Schema:
sales (alias: sale)(code, type, value, salary)
categories(name, level, status, salary)
Task: Retrieve code from sales that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07685 | train |
v1 | Schema:
sales (alias: sale)(level, id, type, value)
categories(name, type, amount, code)
Task: Retrieve id from sales whose level is found in categories rows where code matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07686 | train |
v2 | Schema:
items (alias: lne)(date, name, value, amount)
employees(name, code, value, date)
Task: Retrieve amount from items that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07687 | train |
v3 | Schema:
invoices (alias: inv)(id, level, code, value)
orders(level, status, type, amount)
Task: Retrieve salary from invoices with value above the COUNT(salary) of orders rows sharing the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07688 | train |
v1 | Schema:
customers (alias: cust)(name, salary, id, type)
employees(salary, code, status, value)
Task: Retrieve value from customers whose status is found in employees rows where id matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07689 | train |
v2 | Schema:
departments (alias: dept)(status, date, level, id)
invoices(code, value, name, id)
Task: Find code from departments where a matching record exists in invoices with the same code.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07690 | train |
v2 | Schema:
departments (alias: dept)(value, amount, id, name)
products(code, value, id, salary)
Task: Retrieve amount from departments that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07691 | train |
v1 | Schema:
sales (alias: sale)(status, type, date, id)
managers(type, amount, code, value)
Task: Select salary from sales where status exists in managers for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07692 | train |
v1 | Schema:
employees (alias: emp)(type, level, code, date)
items(value, code, level, date)
Task: Retrieve name from employees whose type is found in items rows where level matches the outer record.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07693 | train |
v1 | Schema:
branches (alias: brc)(salary, level, status, amount)
requests(amount, name, date, code)
Task: Retrieve salary from branches whose type is found in requests rows where status matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07694 | train |
v2 | Schema:
tasks (alias: tsk)(status, value, type, date)
managers(salary, level, status, name)
Task: Retrieve amount from tasks that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "tsk",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07695 | train |
v3 | Schema:
tasks (alias: tsk)(type, value, level, status)
accounts(code, level, date, name)
Task: Find code from tasks where salary exceeds the maximum amount from accounts for the same code.
SQL: | SELECT code FROM tasks AS tsk
WHERE salary > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07696 | train |
v1 | Schema:
branches (alias: brc)(status, name, amount, value)
orders(status, type, amount, salary)
Task: Select value from branches where id exists in orders for the same type.
SQL: | SELECT value FROM branches AS brc
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07697 | train |
v2 | Schema:
invoices (alias: inv)(level, amount, name, id)
employees(name, id, level, value)
Task: Find value from invoices where a matching record exists in employees with the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07698 | train |
v1 | Schema:
tasks (alias: tsk)(id, amount, level, code)
products(amount, status, type, level)
Task: Find code from tasks where status appears in products entries with matching id.
SQL: | SELECT code FROM tasks AS tsk
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.