variant stringclasses 3
values | prompt stringlengths 165 235 | sql stringlengths 104 143 | metadata unknown | id stringlengths 15 15 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v1 | Schema:
warehouses (alias: acct)(salary, code, amount, status)
tasks(id, level, value, date)
Task: Retrieve name from warehouses whose type is found in tasks rows where type matches the outer record.
SQL: | SELECT name FROM warehouses AS acct
WHERE type IN (
SELECT type FROM tasks AS txn
WHERE txn.type = acct.type
); | {
"outer_table": "warehouses",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1"
} | cs8_train_00700 | train | T1 |
v3 | Schema:
products (alias: schd)(status, name, salary, type)
employees(type, salary, value, status)
Task: Find id from products where value exceeds the average value from employees for the same status.
SQL: | SELECT id FROM products AS schd
WHERE value > (
SELECT AVG(value) FROM employees AS txn
WHERE txn.status = schd.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_train_00701 | train | T2 |
v1 | Schema:
branches (alias: dept)(amount, salary, value, status)
warehouses(type, value, date, status)
Task: Select name from branches where level exists in warehouses for the same id.
SQL: | SELECT name FROM branches AS dept
WHERE level IN (
SELECT level FROM warehouses AS empl
WHERE empl.id = dept.id
); | {
"outer_table": "branches",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_train_00702 | train | T1 |
v1 | Schema:
branches (alias: lne)(value, amount, status, date)
departments(id, code, date, level)
Task: Retrieve salary from branches whose id is found in departments rows where code matches the outer record.
SQL: | SELECT salary FROM branches AS lne
WHERE id IN (
SELECT id FROM departments AS budg
WHERE budg.code = lne.code
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_train_00703 | train | T2 |
v1 | Schema:
shipments (alias: txn)(amount, salary, date, status)
customers(name, level, salary, id)
Task: Retrieve name from shipments whose level is found in customers rows where type matches the outer record.
SQL: | SELECT name FROM shipments AS txn
WHERE level IN (
SELECT level FROM customers AS srvc
WHERE srvc.type = txn.type
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_train_00704 | train | T1 |
v1 | Schema:
warehouses (alias: budg)(status, name, id, value)
employees(type, amount, code, status)
Task: Select name from warehouses where level exists in employees for the same status.
SQL: | SELECT name FROM warehouses AS budg
WHERE level IN (
SELECT level FROM employees AS lne
WHERE lne.status = budg.status
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_train_00705 | train | T2 |
v1 | Schema:
accounts (alias: shp)(salary, amount, status, code)
branches(name, salary, type, date)
Task: Find amount from accounts where level appears in branches entries with matching status.
SQL: | SELECT amount FROM accounts AS shp
WHERE level IN (
SELECT level FROM branches AS ord
WHERE ord.status = shp.status
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_train_00706 | train | T2 |
v1 | Schema:
projects (alias: txn)(name, status, type, amount)
tasks(value, name, code, date)
Task: Retrieve salary from projects whose type is found in tasks rows where status matches the outer record.
SQL: | SELECT salary FROM projects AS txn
WHERE type IN (
SELECT type FROM tasks AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_train_00707 | train | T1 |
v3 | Schema:
transactions (alias: rgn)(type, value, status, id)
customers(salary, name, status, amount)
Task: Retrieve code from transactions with value above the AVG(salary) of customers rows sharing the same id.
SQL: | SELECT code FROM transactions AS rgn
WHERE value > (
SELECT AVG(salary) FROM customers AS ordr
WHERE ordr.id = rgn.id
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_train_00708 | train | T2 |
v2 | Schema:
categories (alias: inv)(name, id, value, level)
regions(name, code, id, date)
Task: Retrieve id from categories that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT id FROM categories AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS ordr
WHERE ordr.status = inv.status
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_train_00709 | train | T1 |
v3 | Schema:
orders (alias: budg)(code, value, name, amount)
categories(salary, amount, id, date)
Task: Find id from orders where value exceeds the average value from categories for the same level.
SQL: | SELECT id FROM orders AS budg
WHERE value > (
SELECT SUM(value) FROM categories AS ordr
WHERE ordr.level = budg.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_train_00710 | train | T2 |
v1 | Schema:
orders (alias: srvc)(amount, salary, status, level)
products(salary, name, level, amount)
Task: Retrieve amount from orders whose code is found in products rows where level matches the outer record.
SQL: | SELECT amount FROM orders AS srvc
WHERE code IN (
SELECT code FROM products AS txn
WHERE txn.level = srvc.level
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_train_00711 | train | T2 |
v1 | Schema:
categories (alias: dept)(type, amount, status, code)
customers(id, salary, value, level)
Task: Find name from categories where code appears in customers entries with matching id.
SQL: | SELECT name FROM categories AS dept
WHERE code IN (
SELECT code FROM customers AS budg
WHERE budg.id = dept.id
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_train_00712 | train | T1 |
v3 | Schema:
employees (alias: dept)(salary, name, code, amount)
orders(salary, code, id, status)
Task: Find amount from employees where value exceeds the average value from orders for the same code.
SQL: | SELECT amount FROM employees AS dept
WHERE value > (
SELECT MAX(value) FROM orders AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_train_00713 | train | T1 |
v2 | Schema:
invoices (alias: ord)(amount, id, code, name)
transactions(id, value, name, amount)
Task: Retrieve name from invoices that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT name FROM invoices AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_train_00714 | train | T1 |
v3 | Schema:
categories (alias: txn)(date, value, code, amount)
departments(amount, id, code, type)
Task: Find amount from categories where amount exceeds the average value from departments for the same status.
SQL: | SELECT amount FROM categories AS txn
WHERE amount > (
SELECT MIN(value) FROM departments AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_train_00715 | train | T1 |
v1 | Schema:
projects (alias: sale)(type, status, name, salary)
products(status, id, code, type)
Task: Select value from projects where type exists in products for the same level.
SQL: | SELECT value FROM projects AS sale
WHERE type IN (
SELECT type FROM products AS shp
WHERE shp.level = sale.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_train_00716 | train | T1 |
v1 | Schema:
projects (alias: budg)(level, value, type, code)
warehouses(status, amount, salary, level)
Task: Retrieve name from projects whose id is found in warehouses rows where code matches the outer record.
SQL: | SELECT name FROM projects AS budg
WHERE id IN (
SELECT id FROM warehouses AS rgn
WHERE rgn.code = budg.code
); | {
"outer_table": "projects",
"inner_table": "warehouses",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_train_00717 | train | T2 |
v3 | Schema:
warehouses (alias: prod)(date, salary, status, code)
invoices(name, salary, date, level)
Task: Retrieve id from warehouses with salary above the MAX(amount) of invoices rows sharing the same level.
SQL: | SELECT id FROM warehouses AS prod
WHERE salary > (
SELECT MAX(amount) FROM invoices AS schd
WHERE schd.level = prod.level
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_train_00718 | train | T1 |
v1 | Schema:
customers (alias: mgr)(amount, salary, type, value)
regions(value, type, name, code)
Task: Select amount from customers where id exists in regions for the same status.
SQL: | SELECT amount FROM customers AS mgr
WHERE id IN (
SELECT id FROM regions AS cust
WHERE cust.status = mgr.status
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_train_00719 | train | T1 |
v3 | Schema:
branches (alias: ordr)(date, name, level, value)
departments(salary, id, date, type)
Task: Find code from branches where salary exceeds the average salary from departments for the same code.
SQL: | SELECT code FROM branches AS ordr
WHERE salary > (
SELECT MAX(salary) FROM departments AS acct
WHERE acct.code = ordr.code
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_train_00720 | train | T2 |
v1 | Schema:
warehouses (alias: mgr)(value, date, name, salary)
suppliers(id, salary, level, code)
Task: Retrieve salary from warehouses whose code is found in suppliers rows where code matches the outer record.
SQL: | SELECT salary FROM warehouses AS mgr
WHERE code IN (
SELECT code FROM suppliers AS acct
WHERE acct.code = mgr.code
); | {
"outer_table": "warehouses",
"inner_table": "suppliers",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_train_00721 | train | T1 |
v2 | Schema:
tasks (alias: budg)(name, code, amount, status)
shipments(name, amount, date, value)
Task: Find code from tasks where a matching record exists in shipments with the same type.
SQL: | SELECT code FROM tasks AS budg
WHERE EXISTS (
SELECT 1 FROM shipments AS dept
WHERE dept.type = budg.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_train_00722 | train | T2 |
v2 | Schema:
transactions (alias: inv)(status, id, salary, type)
tasks(salary, status, amount, name)
Task: Find amount from transactions where a matching record exists in tasks with the same status.
SQL: | SELECT amount FROM transactions AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS whs
WHERE whs.status = inv.status
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_train_00723 | train | T1 |
v1 | Schema:
employees (alias: ord)(value, date, amount, code)
shipments(salary, type, date, code)
Task: Find name from employees where id appears in shipments entries with matching type.
SQL: | SELECT name FROM employees AS ord
WHERE id IN (
SELECT id FROM shipments AS cust
WHERE cust.type = ord.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_train_00724 | train | T1 |
v3 | Schema:
employees (alias: schd)(code, type, value, status)
accounts(date, amount, value, code)
Task: Retrieve code from employees with salary above the AVG(amount) of accounts rows sharing the same id.
SQL: | SELECT code FROM employees AS schd
WHERE salary > (
SELECT AVG(amount) FROM accounts AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_train_00725 | train | T2 |
v2 | Schema:
branches (alias: lne)(value, status, amount, code)
tasks(code, id, value, type)
Task: Find id from branches where a matching record exists in tasks with the same code.
SQL: | SELECT id FROM branches AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS ord
WHERE ord.code = lne.code
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_train_00726 | train | T2 |
v1 | Schema:
warehouses (alias: txn)(level, type, amount, status)
transactions(status, level, amount, date)
Task: Select name from warehouses where id exists in transactions for the same code.
SQL: | SELECT name FROM warehouses AS txn
WHERE id IN (
SELECT id FROM transactions AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_train_00727 | train | T1 |
v1 | Schema:
departments (alias: whs)(amount, status, type, value)
categories(amount, name, level, type)
Task: Select name from departments where status exists in categories for the same status.
SQL: | SELECT name FROM departments AS whs
WHERE status IN (
SELECT status FROM categories AS srvc
WHERE srvc.status = whs.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_train_00728 | train | T2 |
v2 | Schema:
tasks (alias: schd)(name, id, salary, level)
employees(status, date, value, name)
Task: Retrieve name from tasks that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT name FROM tasks AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS srvc
WHERE srvc.status = schd.status
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_train_00729 | train | T2 |
v3 | Schema:
orders (alias: dept)(level, value, amount, date)
shipments(id, date, name, code)
Task: Retrieve code from orders with amount above the MAX(amount) of shipments rows sharing the same code.
SQL: | SELECT code FROM orders AS dept
WHERE amount > (
SELECT MAX(amount) FROM shipments AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_train_00730 | train | T1 |
v1 | Schema:
categories (alias: ord)(status, amount, date, salary)
employees(salary, id, level, name)
Task: Select amount from categories where level exists in employees for the same status.
SQL: | SELECT amount FROM categories AS ord
WHERE level IN (
SELECT level FROM employees AS inv
WHERE inv.status = ord.status
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_train_00731 | train | T1 |
v3 | Schema:
transactions (alias: shp)(id, type, date, code)
categories(name, date, code, salary)
Task: Retrieve code from transactions with amount above the SUM(salary) of categories rows sharing the same id.
SQL: | SELECT code FROM transactions AS shp
WHERE amount > (
SELECT SUM(salary) FROM categories AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_train_00732 | train | T2 |
v1 | Schema:
products (alias: inv)(value, name, date, amount)
tasks(name, salary, status, value)
Task: Select code from products where id exists in tasks for the same status.
SQL: | SELECT code FROM products AS inv
WHERE id IN (
SELECT id FROM tasks AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_train_00733 | train | T1 |
v2 | Schema:
employees (alias: schd)(salary, name, level, type)
tasks(type, date, value, salary)
Task: Retrieve id from employees that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT id FROM employees AS schd
WHERE EXISTS (
SELECT 1 FROM tasks AS inv
WHERE inv.code = schd.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_train_00734 | train | T2 |
v1 | Schema:
orders (alias: sale)(date, id, level, salary)
branches(code, date, amount, id)
Task: Find value from orders where status appears in branches entries with matching code.
SQL: | SELECT value FROM orders AS sale
WHERE status IN (
SELECT status FROM branches AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_train_00735 | train | T1 |
v1 | Schema:
tasks (alias: rgn)(code, salary, status, type)
warehouses(status, value, type, name)
Task: Retrieve salary from tasks whose type is found in warehouses rows where level matches the outer record.
SQL: | SELECT salary FROM tasks AS rgn
WHERE type IN (
SELECT type FROM warehouses AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "tasks",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_train_00736 | train | T2 |
v1 | Schema:
products (alias: schd)(type, name, level, status)
shipments(id, value, level, name)
Task: Select code from products where type exists in shipments for the same code.
SQL: | SELECT code FROM products AS schd
WHERE type IN (
SELECT type FROM shipments AS dept
WHERE dept.code = schd.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_train_00737 | train | T2 |
v1 | Schema:
accounts (alias: prod)(value, amount, id, status)
transactions(date, code, salary, status)
Task: Retrieve id from accounts whose id is found in transactions rows where type matches the outer record.
SQL: | SELECT id FROM accounts AS prod
WHERE id IN (
SELECT id FROM transactions AS emp
WHERE emp.type = prod.type
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_train_00738 | train | T1 |
v2 | Schema:
customers (alias: txn)(date, code, salary, type)
transactions(level, value, name, date)
Task: Find amount from customers where a matching record exists in transactions with the same type.
SQL: | SELECT amount FROM customers AS txn
WHERE EXISTS (
SELECT 1 FROM transactions AS srvc
WHERE srvc.type = txn.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_train_00739 | train | T1 |
v3 | Schema:
accounts (alias: rgn)(type, value, name, code)
tasks(id, code, value, level)
Task: Retrieve salary from accounts with value above the SUM(salary) of tasks rows sharing the same code.
SQL: | SELECT salary FROM accounts AS rgn
WHERE value > (
SELECT SUM(salary) FROM tasks AS ordr
WHERE ordr.code = rgn.code
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_train_00740 | train | T2 |
v3 | Schema:
products (alias: inv)(status, date, type, value)
projects(type, code, value, id)
Task: Find name from products where value exceeds the average salary from projects for the same type.
SQL: | SELECT name FROM products AS inv
WHERE value > (
SELECT MAX(salary) FROM projects AS emp
WHERE emp.type = inv.type
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_train_00741 | train | T1 |
v3 | Schema:
accounts (alias: shp)(status, salary, name, date)
shipments(value, type, status, code)
Task: Find id from accounts where value exceeds the average value from shipments for the same type.
SQL: | SELECT id FROM accounts AS shp
WHERE value > (
SELECT MIN(value) FROM shipments AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_train_00742 | train | T2 |
v3 | Schema:
shipments (alias: budg)(date, level, type, status)
transactions(value, level, id, type)
Task: Find salary from shipments where value exceeds the average amount from transactions for the same type.
SQL: | SELECT salary FROM shipments AS budg
WHERE value > (
SELECT MAX(amount) FROM transactions AS dept
WHERE dept.type = budg.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_train_00743 | train | T2 |
v1 | Schema:
orders (alias: rgn)(value, salary, status, amount)
products(id, name, type, date)
Task: Find name from orders where status appears in products entries with matching type.
SQL: | SELECT name FROM orders AS rgn
WHERE status IN (
SELECT status FROM products AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_train_00744 | train | T2 |
v1 | Schema:
warehouses (alias: empl)(level, id, salary, value)
customers(value, level, name, salary)
Task: Select value from warehouses where level exists in customers for the same code.
SQL: | SELECT value FROM warehouses AS empl
WHERE level IN (
SELECT level FROM customers AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_train_00745 | train | T2 |
v2 | Schema:
orders (alias: shp)(name, date, level, amount)
branches(type, date, value, level)
Task: Find code from orders where a matching record exists in branches with the same status.
SQL: | SELECT code FROM orders AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS acct
WHERE acct.status = shp.status
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_train_00746 | train | T2 |
v2 | Schema:
shipments (alias: catg)(amount, level, status, salary)
suppliers(type, salary, status, level)
Task: Retrieve salary from shipments that have at least one corresponding entry in suppliers sharing the same code.
SQL: | SELECT salary FROM shipments AS catg
WHERE EXISTS (
SELECT 1 FROM suppliers AS srvc
WHERE srvc.code = catg.code
); | {
"outer_table": "shipments",
"inner_table": "suppliers",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_train_00747 | train | T2 |
v1 | Schema:
warehouses (alias: catg)(amount, type, value, date)
categories(salary, level, code, type)
Task: Find value from warehouses where id appears in categories entries with matching id.
SQL: | SELECT value FROM warehouses AS catg
WHERE id IN (
SELECT id FROM categories AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_train_00748 | train | T2 |
v2 | Schema:
categories (alias: shp)(code, id, level, value)
departments(level, status, date, value)
Task: Retrieve code from categories that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM categories AS shp
WHERE EXISTS (
SELECT 1 FROM departments AS lne
WHERE lne.id = shp.id
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_train_00749 | train | T2 |
v1 | Schema:
warehouses (alias: empl)(level, name, amount, code)
accounts(id, name, salary, level)
Task: Select salary from warehouses where level exists in accounts for the same type.
SQL: | SELECT salary FROM warehouses AS empl
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = empl.type
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_train_00750 | train | T2 |
v3 | Schema:
orders (alias: empl)(name, amount, code, id)
transactions(code, level, name, salary)
Task: Find salary from orders where amount exceeds the average value from transactions for the same type.
SQL: | SELECT salary FROM orders AS empl
WHERE amount > (
SELECT MIN(value) FROM transactions AS dept
WHERE dept.type = empl.type
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_train_00751 | train | T2 |
v2 | Schema:
regions (alias: txn)(amount, id, date, name)
accounts(id, date, amount, type)
Task: Find name from regions where a matching record exists in accounts with the same code.
SQL: | SELECT name FROM regions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_train_00752 | train | T1 |
v1 | Schema:
shipments (alias: inv)(level, date, id, amount)
tasks(value, type, amount, date)
Task: Find code from shipments where level appears in tasks entries with matching status.
SQL: | SELECT code FROM shipments AS inv
WHERE level IN (
SELECT level FROM tasks AS rgn
WHERE rgn.status = inv.status
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_train_00753 | train | T1 |
v2 | Schema:
employees (alias: catg)(type, salary, date, status)
orders(id, amount, level, type)
Task: Find salary from employees where a matching record exists in orders with the same code.
SQL: | SELECT salary FROM employees AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_train_00754 | train | T2 |
v2 | Schema:
invoices (alias: schd)(salary, value, code, level)
categories(status, code, name, level)
Task: Find name from invoices where a matching record exists in categories with the same code.
SQL: | SELECT name FROM invoices AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_train_00755 | train | T2 |
v2 | Schema:
products (alias: txn)(salary, name, amount, code)
departments(status, name, code, amount)
Task: Retrieve id from products that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT id FROM products AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS sale
WHERE sale.level = txn.level
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_train_00756 | train | T1 |
v1 | Schema:
transactions (alias: rgn)(id, code, value, type)
invoices(value, type, amount, status)
Task: Select code from transactions where level exists in invoices for the same code.
SQL: | SELECT code FROM transactions AS rgn
WHERE level IN (
SELECT level FROM invoices AS whs
WHERE whs.code = rgn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_train_00757 | train | T2 |
v2 | Schema:
regions (alias: lne)(amount, name, id, salary)
categories(type, id, date, salary)
Task: Retrieve salary from regions that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT salary FROM regions AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS empl
WHERE empl.status = lne.status
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_train_00758 | train | T2 |
v1 | Schema:
categories (alias: prod)(value, level, code, id)
employees(date, code, status, name)
Task: Select value from categories where status exists in employees for the same level.
SQL: | SELECT value FROM categories AS prod
WHERE status IN (
SELECT status FROM employees AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_train_00759 | train | T1 |
v2 | Schema:
projects (alias: ord)(level, type, salary, value)
categories(salary, status, value, date)
Task: Find code from projects where a matching record exists in categories with the same level.
SQL: | SELECT code FROM projects AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS srvc
WHERE srvc.level = ord.level
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "srvc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_train_00760 | train | T1 |
v1 | Schema:
projects (alias: inv)(date, value, salary, status)
branches(date, name, salary, status)
Task: Retrieve code from projects whose status is found in branches rows where type matches the outer record.
SQL: | SELECT code FROM projects AS inv
WHERE status IN (
SELECT status FROM branches AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_train_00761 | train | T1 |
v3 | Schema:
employees (alias: ord)(date, type, value, amount)
tasks(status, amount, type, name)
Task: Find salary from employees where value exceeds the average value from tasks for the same type.
SQL: | SELECT salary FROM employees AS ord
WHERE value > (
SELECT MAX(value) FROM tasks AS cust
WHERE cust.type = ord.type
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_train_00762 | train | T1 |
v1 | Schema:
suppliers (alias: mgr)(status, amount, code, level)
employees(value, id, date, type)
Task: Select salary from suppliers where level exists in employees for the same type.
SQL: | SELECT salary FROM suppliers AS mgr
WHERE level IN (
SELECT level FROM employees AS txn
WHERE txn.type = mgr.type
); | {
"outer_table": "suppliers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_train_00763 | train | T1 |
v2 | Schema:
accounts (alias: prod)(id, value, type, level)
warehouses(salary, id, date, status)
Task: Find id from accounts where a matching record exists in warehouses with the same status.
SQL: | SELECT id FROM accounts AS prod
WHERE EXISTS (
SELECT 1 FROM warehouses AS empl
WHERE empl.status = prod.status
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_train_00764 | train | T1 |
v3 | Schema:
orders (alias: ord)(id, value, level, type)
shipments(code, name, type, amount)
Task: Retrieve salary from orders with amount above the SUM(value) of shipments rows sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT SUM(value) FROM shipments AS sale
WHERE sale.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_train_00765 | train | T1 |
v3 | Schema:
regions (alias: cust)(type, salary, level, amount)
shipments(date, name, value, id)
Task: Find code from regions where value exceeds the average salary from shipments for the same status.
SQL: | SELECT code FROM regions AS cust
WHERE value > (
SELECT MIN(salary) FROM shipments AS srvc
WHERE srvc.status = cust.status
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_train_00766 | train | T1 |
v3 | Schema:
regions (alias: prod)(type, value, salary, level)
shipments(level, type, value, status)
Task: Find id from regions where amount exceeds the average salary from shipments for the same level.
SQL: | SELECT id FROM regions AS prod
WHERE amount > (
SELECT MAX(salary) FROM shipments AS catg
WHERE catg.level = prod.level
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_train_00767 | train | T1 |
v3 | Schema:
shipments (alias: catg)(level, status, type, name)
invoices(status, salary, code, id)
Task: Retrieve id from shipments with amount above the AVG(amount) of invoices rows sharing the same code.
SQL: | SELECT id FROM shipments AS catg
WHERE amount > (
SELECT AVG(amount) FROM invoices AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_train_00768 | train | T2 |
v3 | Schema:
customers (alias: txn)(amount, name, value, type)
departments(status, name, code, level)
Task: Retrieve salary from customers with salary above the MAX(amount) of departments rows sharing the same level.
SQL: | SELECT salary FROM customers AS txn
WHERE salary > (
SELECT MAX(amount) FROM departments AS catg
WHERE catg.level = txn.level
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_train_00769 | train | T1 |
v1 | Schema:
warehouses (alias: emp)(value, type, status, id)
invoices(value, date, id, status)
Task: Select value from warehouses where type exists in invoices for the same status.
SQL: | SELECT value FROM warehouses AS emp
WHERE type IN (
SELECT type FROM invoices AS budg
WHERE budg.status = emp.status
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_train_00770 | train | T1 |
v2 | Schema:
products (alias: lne)(date, status, name, id)
projects(id, type, code, level)
Task: Find salary from products where a matching record exists in projects with the same type.
SQL: | SELECT salary FROM products AS lne
WHERE EXISTS (
SELECT 1 FROM projects AS acct
WHERE acct.type = lne.type
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_train_00771 | train | T2 |
v1 | Schema:
products (alias: schd)(status, value, id, date)
transactions(id, value, status, amount)
Task: Retrieve code from products whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT code FROM products AS schd
WHERE level IN (
SELECT level FROM transactions AS lne
WHERE lne.level = schd.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_train_00772 | train | T2 |
v2 | Schema:
departments (alias: rgn)(code, status, date, amount)
warehouses(status, value, type, id)
Task: Retrieve id from departments that have at least one corresponding entry in warehouses sharing the same id.
SQL: | SELECT id FROM departments AS rgn
WHERE EXISTS (
SELECT 1 FROM warehouses AS budg
WHERE budg.id = rgn.id
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_train_00773 | train | T2 |
v3 | Schema:
warehouses (alias: schd)(id, amount, name, status)
transactions(id, value, date, salary)
Task: Find code from warehouses where value exceeds the average salary from transactions for the same type.
SQL: | SELECT code FROM warehouses AS schd
WHERE value > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.type = schd.type
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_train_00774 | train | T2 |
v3 | Schema:
regions (alias: srvc)(salary, code, id, type)
orders(name, amount, value, type)
Task: Retrieve value from regions with value above the SUM(salary) of orders rows sharing the same id.
SQL: | SELECT value FROM regions AS srvc
WHERE value > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.id = srvc.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_train_00775 | train | T2 |
v3 | Schema:
branches (alias: acct)(level, date, salary, type)
invoices(salary, value, date, level)
Task: Find name from branches where amount exceeds the average value from invoices for the same id.
SQL: | SELECT name FROM branches AS acct
WHERE amount > (
SELECT SUM(value) FROM invoices AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_train_00776 | train | T1 |
v1 | Schema:
accounts (alias: empl)(date, id, type, level)
transactions(type, value, name, salary)
Task: Find value from accounts where level appears in transactions entries with matching id.
SQL: | SELECT value FROM accounts AS empl
WHERE level IN (
SELECT level FROM transactions AS ordr
WHERE ordr.id = empl.id
); | {
"outer_table": "accounts",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_train_00777 | train | T2 |
v2 | Schema:
warehouses (alias: inv)(date, level, salary, amount)
suppliers(level, code, salary, date)
Task: Retrieve value from warehouses that have at least one corresponding entry in suppliers sharing the same id.
SQL: | SELECT value FROM warehouses AS inv
WHERE EXISTS (
SELECT 1 FROM suppliers AS rgn
WHERE rgn.id = inv.id
); | {
"outer_table": "warehouses",
"inner_table": "suppliers",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_train_00778 | train | T1 |
v3 | Schema:
invoices (alias: inv)(name, type, id, code)
shipments(value, date, id, level)
Task: Retrieve name from invoices with amount above the SUM(amount) of shipments rows sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT SUM(amount) FROM shipments AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_train_00779 | train | T1 |
v3 | Schema:
orders (alias: inv)(code, level, status, name)
invoices(id, amount, status, salary)
Task: Find salary from orders where amount exceeds the average amount from invoices for the same id.
SQL: | SELECT salary FROM orders AS inv
WHERE amount > (
SELECT COUNT(amount) FROM invoices AS mgr
WHERE mgr.id = inv.id
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_train_00780 | train | T1 |
v2 | Schema:
products (alias: catg)(date, salary, level, name)
branches(name, status, id, type)
Task: Find salary from products where a matching record exists in branches with the same level.
SQL: | SELECT salary FROM products AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS shp
WHERE shp.level = catg.level
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_train_00781 | train | T2 |
v3 | Schema:
invoices (alias: empl)(status, salary, name, id)
regions(status, date, code, amount)
Task: Retrieve id from invoices with salary above the MAX(salary) of regions rows sharing the same status.
SQL: | SELECT id FROM invoices AS empl
WHERE salary > (
SELECT MAX(salary) FROM regions AS shp
WHERE shp.status = empl.status
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_train_00782 | train | T2 |
v2 | Schema:
projects (alias: inv)(level, salary, status, name)
employees(level, id, status, code)
Task: Find amount from projects where a matching record exists in employees with the same status.
SQL: | SELECT amount FROM projects AS inv
WHERE EXISTS (
SELECT 1 FROM employees AS prod
WHERE prod.status = inv.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_train_00783 | train | T1 |
v3 | Schema:
branches (alias: dept)(code, id, salary, value)
employees(salary, status, date, id)
Task: Find code from branches where salary exceeds the average amount from employees for the same code.
SQL: | SELECT code FROM branches AS dept
WHERE salary > (
SELECT COUNT(amount) FROM employees AS mgr
WHERE mgr.code = dept.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_train_00784 | train | T1 |
v1 | Schema:
branches (alias: budg)(value, id, date, amount)
departments(type, status, salary, amount)
Task: Find salary from branches where level appears in departments entries with matching id.
SQL: | SELECT salary FROM branches AS budg
WHERE level IN (
SELECT level FROM departments AS rgn
WHERE rgn.id = budg.id
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "budg",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_train_00785 | train | T2 |
v2 | Schema:
branches (alias: budg)(status, type, code, id)
products(salary, status, name, value)
Task: Retrieve id from branches that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT id FROM branches AS budg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = budg.level
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_train_00786 | train | T2 |
v3 | Schema:
transactions (alias: cust)(value, id, type, amount)
orders(status, code, level, salary)
Task: Retrieve id from transactions with salary above the SUM(salary) of orders rows sharing the same status.
SQL: | SELECT id FROM transactions AS cust
WHERE salary > (
SELECT SUM(salary) FROM orders AS shp
WHERE shp.status = cust.status
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_train_00787 | train | T1 |
v2 | Schema:
projects (alias: prod)(salary, code, name, value)
accounts(status, code, salary, amount)
Task: Find value from projects where a matching record exists in accounts with the same status.
SQL: | SELECT value FROM projects AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS txn
WHERE txn.status = prod.status
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_train_00788 | train | T1 |
v2 | Schema:
transactions (alias: rgn)(level, name, status, value)
branches(amount, date, type, value)
Task: Find value from transactions where a matching record exists in branches with the same level.
SQL: | SELECT value FROM transactions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS budg
WHERE budg.level = rgn.level
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "budg",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_train_00789 | train | T2 |
v2 | Schema:
warehouses (alias: budg)(type, level, amount, status)
branches(type, code, status, id)
Task: Find value from warehouses where a matching record exists in branches with the same level.
SQL: | SELECT value FROM warehouses AS budg
WHERE EXISTS (
SELECT 1 FROM branches AS acct
WHERE acct.level = budg.level
); | {
"outer_table": "warehouses",
"inner_table": "branches",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_train_00790 | train | T2 |
v3 | Schema:
projects (alias: inv)(status, level, date, name)
branches(salary, date, name, value)
Task: Find id from projects where value exceeds the average amount from branches for the same status.
SQL: | SELECT id FROM projects AS inv
WHERE value > (
SELECT MAX(amount) FROM branches AS srvc
WHERE srvc.status = inv.status
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_train_00791 | train | T1 |
v3 | Schema:
employees (alias: inv)(type, status, date, name)
tasks(name, status, salary, code)
Task: Find value from employees where amount exceeds the average value from tasks for the same code.
SQL: | SELECT value FROM employees AS inv
WHERE amount > (
SELECT MAX(value) FROM tasks AS txn
WHERE txn.code = inv.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_train_00792 | train | T1 |
v1 | Schema:
projects (alias: lne)(status, amount, name, type)
customers(name, salary, id, amount)
Task: Find id from projects where type appears in customers entries with matching level.
SQL: | SELECT id FROM projects AS lne
WHERE type IN (
SELECT type FROM customers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_train_00793 | train | T2 |
v1 | Schema:
employees (alias: ordr)(status, level, code, salary)
invoices(value, amount, type, salary)
Task: Find name from employees where status appears in invoices entries with matching level.
SQL: | SELECT name FROM employees AS ordr
WHERE status IN (
SELECT status FROM invoices AS budg
WHERE budg.level = ordr.level
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_train_00794 | train | T2 |
v2 | Schema:
departments (alias: inv)(value, status, code, id)
transactions(type, code, value, id)
Task: Find amount from departments where a matching record exists in transactions with the same id.
SQL: | SELECT amount FROM departments AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS schd
WHERE schd.id = inv.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_train_00795 | train | T1 |
v2 | Schema:
suppliers (alias: budg)(code, amount, salary, date)
customers(status, value, id, type)
Task: Find salary from suppliers where a matching record exists in customers with the same type.
SQL: | SELECT salary FROM suppliers AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS acct
WHERE acct.type = budg.type
); | {
"outer_table": "suppliers",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_train_00796 | train | T2 |
v2 | Schema:
transactions (alias: shp)(code, date, name, id)
shipments(level, type, code, value)
Task: Find code from transactions where a matching record exists in shipments with the same type.
SQL: | SELECT code FROM transactions AS shp
WHERE EXISTS (
SELECT 1 FROM shipments AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_train_00797 | train | T2 |
v3 | Schema:
orders (alias: srvc)(salary, level, type, value)
projects(code, level, type, date)
Task: Retrieve amount from orders with value above the AVG(amount) of projects rows sharing the same code.
SQL: | SELECT amount FROM orders AS srvc
WHERE value > (
SELECT AVG(amount) FROM projects AS catg
WHERE catg.code = srvc.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_train_00798 | train | T2 |
v2 | Schema:
invoices (alias: acct)(salary, value, code, status)
accounts(id, code, date, value)
Task: Retrieve value from invoices that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT value FROM invoices AS acct
WHERE EXISTS (
SELECT 1 FROM accounts AS inv
WHERE inv.code = acct.code
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_train_00799 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.