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 |
|---|---|---|---|---|---|---|
v2 | Schema:
projects (alias: ord)(salary, name, amount, code)
products(level, salary, code, value)
Task: Find value from projects where a matching record exists in products with the same level.
SQL: | SELECT value FROM projects AS ord
WHERE EXISTS (
SELECT 1 FROM products AS shp
WHERE shp.level = ord.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_train_00400 | train | T1 |
v1 | Schema:
transactions (alias: mgr)(amount, date, type, code)
branches(id, type, salary, date)
Task: Retrieve value from transactions whose id is found in branches rows where id matches the outer record.
SQL: | SELECT value FROM transactions AS mgr
WHERE id IN (
SELECT id FROM branches AS schd
WHERE schd.id = mgr.id
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_train_00401 | train | T1 |
v3 | Schema:
regions (alias: rgn)(salary, id, date, code)
projects(type, level, value, code)
Task: Retrieve name from regions with salary above the AVG(value) of projects rows sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE salary > (
SELECT AVG(value) FROM projects AS whs
WHERE whs.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_train_00402 | train | T2 |
v1 | Schema:
shipments (alias: mgr)(id, name, type, code)
projects(id, date, amount, level)
Task: Select name from shipments where type exists in projects for the same level.
SQL: | SELECT name FROM shipments AS mgr
WHERE type IN (
SELECT type FROM projects AS acct
WHERE acct.level = mgr.level
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_train_00403 | train | T1 |
v3 | Schema:
employees (alias: sale)(id, code, value, date)
orders(id, name, date, status)
Task: Retrieve name from employees with salary above the AVG(amount) of orders rows sharing the same status.
SQL: | SELECT name FROM employees AS sale
WHERE salary > (
SELECT AVG(amount) FROM orders AS mgr
WHERE mgr.status = sale.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_train_00404 | train | T1 |
v3 | Schema:
employees (alias: acct)(salary, id, type, name)
regions(salary, name, value, amount)
Task: Retrieve code from employees with salary above the COUNT(amount) of regions rows sharing the same level.
SQL: | SELECT code FROM employees AS acct
WHERE salary > (
SELECT COUNT(amount) FROM regions AS inv
WHERE inv.level = acct.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_train_00405 | train | T1 |
v3 | Schema:
products (alias: ordr)(level, status, amount, code)
categories(id, name, value, level)
Task: Find value from products where amount exceeds the average amount from categories for the same id.
SQL: | SELECT value FROM products AS ordr
WHERE amount > (
SELECT MAX(amount) FROM categories AS budg
WHERE budg.id = ordr.id
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_train_00406 | train | T2 |
v1 | Schema:
accounts (alias: catg)(type, code, id, value)
suppliers(salary, level, date, value)
Task: Find name from accounts where status appears in suppliers entries with matching level.
SQL: | SELECT name FROM accounts AS catg
WHERE status IN (
SELECT status FROM suppliers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "accounts",
"inner_table": "suppliers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_train_00407 | train | T2 |
v2 | Schema:
products (alias: rgn)(id, type, name, value)
branches(name, type, code, id)
Task: Retrieve id from products that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT id FROM products AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_train_00408 | train | T2 |
v1 | Schema:
branches (alias: schd)(salary, code, date, name)
transactions(status, date, type, name)
Task: Find salary from branches where code appears in transactions entries with matching id.
SQL: | SELECT salary FROM branches AS schd
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "branches",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_train_00409 | train | T2 |
v2 | Schema:
branches (alias: rgn)(type, date, value, code)
categories(level, salary, amount, name)
Task: Retrieve code from branches that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT code FROM branches AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS dept
WHERE dept.type = rgn.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_train_00410 | train | T2 |
v2 | Schema:
accounts (alias: shp)(salary, code, status, amount)
branches(status, type, value, salary)
Task: Retrieve salary from accounts that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT salary FROM accounts AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS dept
WHERE dept.type = shp.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_train_00411 | train | T2 |
v3 | Schema:
branches (alias: mgr)(amount, salary, code, type)
tasks(date, name, value, id)
Task: Retrieve amount from branches with amount above the AVG(value) of tasks rows sharing the same level.
SQL: | SELECT amount FROM branches AS mgr
WHERE amount > (
SELECT AVG(value) FROM tasks AS schd
WHERE schd.level = mgr.level
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_train_00412 | train | T1 |
v1 | Schema:
tasks (alias: txn)(type, salary, amount, status)
accounts(value, level, name, code)
Task: Retrieve salary from tasks whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT salary FROM tasks AS txn
WHERE type IN (
SELECT type FROM accounts AS ord
WHERE ord.status = txn.status
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_train_00413 | train | T1 |
v3 | Schema:
shipments (alias: acct)(status, level, date, name)
customers(name, id, code, amount)
Task: Find name from shipments where salary exceeds the average amount from customers for the same code.
SQL: | SELECT name FROM shipments AS acct
WHERE salary > (
SELECT AVG(amount) FROM customers AS budg
WHERE budg.code = acct.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_train_00414 | train | T1 |
v3 | Schema:
transactions (alias: budg)(status, name, type, amount)
warehouses(level, status, date, value)
Task: Retrieve id from transactions with amount above the COUNT(amount) of warehouses rows sharing the same level.
SQL: | SELECT id FROM transactions AS budg
WHERE amount > (
SELECT COUNT(amount) FROM warehouses AS txn
WHERE txn.level = budg.level
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_train_00415 | train | T2 |
v1 | Schema:
transactions (alias: acct)(salary, amount, value, level)
suppliers(level, name, id, date)
Task: Retrieve id from transactions whose level is found in suppliers rows where level matches the outer record.
SQL: | SELECT id FROM transactions AS acct
WHERE level IN (
SELECT level FROM suppliers AS txn
WHERE txn.level = acct.level
); | {
"outer_table": "transactions",
"inner_table": "suppliers",
"outer_alias": "acct",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_train_00416 | train | T1 |
v2 | Schema:
departments (alias: shp)(date, code, level, amount)
customers(name, amount, status, value)
Task: Find value from departments where a matching record exists in customers with the same status.
SQL: | SELECT value FROM departments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS whs
WHERE whs.status = shp.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_train_00417 | train | T2 |
v3 | Schema:
transactions (alias: ordr)(value, level, salary, code)
warehouses(name, type, salary, amount)
Task: Retrieve value from transactions with salary above the MAX(value) of warehouses rows sharing the same level.
SQL: | SELECT value FROM transactions AS ordr
WHERE salary > (
SELECT MAX(value) FROM warehouses AS schd
WHERE schd.level = ordr.level
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_train_00418 | train | T2 |
v1 | Schema:
projects (alias: acct)(salary, value, date, name)
customers(amount, code, id, salary)
Task: Retrieve salary from projects whose code is found in customers rows where id matches the outer record.
SQL: | SELECT salary FROM projects AS acct
WHERE code IN (
SELECT code FROM customers AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_train_00419 | train | T1 |
v1 | Schema:
invoices (alias: ord)(amount, salary, value, name)
customers(level, value, amount, id)
Task: Select amount from invoices where id exists in customers for the same level.
SQL: | SELECT amount FROM invoices AS ord
WHERE id IN (
SELECT id FROM customers AS whs
WHERE whs.level = ord.level
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_train_00420 | train | T1 |
v3 | Schema:
warehouses (alias: shp)(date, amount, value, name)
accounts(date, type, status, name)
Task: Find value from warehouses where value exceeds the average salary from accounts for the same level.
SQL: | SELECT value FROM warehouses AS shp
WHERE value > (
SELECT AVG(salary) FROM accounts AS prod
WHERE prod.level = shp.level
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_train_00421 | train | T2 |
v1 | Schema:
projects (alias: acct)(value, date, status, code)
suppliers(salary, amount, name, type)
Task: Select value from projects where type exists in suppliers for the same status.
SQL: | SELECT value FROM projects AS acct
WHERE type IN (
SELECT type FROM suppliers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "projects",
"inner_table": "suppliers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_train_00422 | train | T1 |
v2 | Schema:
suppliers (alias: dept)(status, salary, date, value)
projects(code, type, date, amount)
Task: Retrieve id from suppliers that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT id FROM suppliers AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS srvc
WHERE srvc.code = dept.code
); | {
"outer_table": "suppliers",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_train_00423 | train | T1 |
v3 | Schema:
shipments (alias: dept)(date, level, salary, name)
customers(type, code, id, salary)
Task: Retrieve name from shipments with amount above the MAX(value) of customers rows sharing the same id.
SQL: | SELECT name FROM shipments AS dept
WHERE amount > (
SELECT MAX(value) FROM customers AS empl
WHERE empl.id = dept.id
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_train_00424 | train | T1 |
v2 | Schema:
orders (alias: dept)(level, value, status, amount)
employees(amount, name, type, date)
Task: Retrieve name from orders that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT name FROM orders AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS mgr
WHERE mgr.code = dept.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_train_00425 | train | T1 |
v1 | Schema:
invoices (alias: shp)(type, name, level, date)
departments(name, amount, status, id)
Task: Select value from invoices where level exists in departments for the same status.
SQL: | SELECT value FROM invoices AS shp
WHERE level IN (
SELECT level FROM departments AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_train_00426 | train | T2 |
v2 | Schema:
orders (alias: ordr)(amount, id, level, value)
transactions(status, salary, type, id)
Task: Find code from orders where a matching record exists in transactions with the same code.
SQL: | SELECT code FROM orders AS ordr
WHERE EXISTS (
SELECT 1 FROM transactions AS budg
WHERE budg.code = ordr.code
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_train_00427 | train | T2 |
v1 | Schema:
customers (alias: sale)(type, amount, status, date)
accounts(status, code, date, id)
Task: Retrieve name from customers whose type is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM customers AS sale
WHERE type IN (
SELECT type FROM accounts AS budg
WHERE budg.code = sale.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_train_00428 | train | T1 |
v1 | Schema:
categories (alias: budg)(name, salary, status, value)
orders(id, value, level, code)
Task: Select code from categories where status exists in orders for the same status.
SQL: | SELECT code FROM categories AS budg
WHERE status IN (
SELECT status FROM orders AS ordr
WHERE ordr.status = budg.status
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_train_00429 | train | T2 |
v3 | Schema:
suppliers (alias: dept)(name, date, type, level)
shipments(amount, type, id, value)
Task: Find salary from suppliers where value exceeds the average value from shipments for the same level.
SQL: | SELECT salary FROM suppliers AS dept
WHERE value > (
SELECT SUM(value) FROM shipments AS emp
WHERE emp.level = dept.level
); | {
"outer_table": "suppliers",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_train_00430 | train | T1 |
v1 | Schema:
shipments (alias: inv)(status, date, name, salary)
products(name, salary, level, type)
Task: Retrieve id from shipments whose level is found in products rows where status matches the outer record.
SQL: | SELECT id FROM shipments AS inv
WHERE level IN (
SELECT level FROM products AS srvc
WHERE srvc.status = inv.status
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_train_00431 | train | T1 |
v3 | Schema:
transactions (alias: catg)(level, code, salary, id)
departments(date, value, salary, type)
Task: Find value from transactions where salary exceeds the average amount from departments for the same code.
SQL: | SELECT value FROM transactions AS catg
WHERE salary > (
SELECT AVG(amount) FROM departments AS srvc
WHERE srvc.code = catg.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_train_00432 | train | T2 |
v2 | Schema:
shipments (alias: acct)(level, id, code, amount)
regions(code, name, salary, amount)
Task: Find value from shipments where a matching record exists in regions with the same id.
SQL: | SELECT value FROM shipments AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_train_00433 | train | T1 |
v1 | Schema:
shipments (alias: inv)(name, level, amount, value)
invoices(status, name, code, date)
Task: Find name from shipments where status appears in invoices entries with matching id.
SQL: | SELECT name FROM shipments AS inv
WHERE status IN (
SELECT status FROM invoices AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_train_00434 | train | T1 |
v1 | Schema:
tasks (alias: prod)(code, status, value, id)
departments(amount, level, name, type)
Task: Select value from tasks where id exists in departments for the same id.
SQL: | SELECT value FROM tasks AS prod
WHERE id IN (
SELECT id FROM departments AS lne
WHERE lne.id = prod.id
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_train_00435 | train | T1 |
v2 | Schema:
warehouses (alias: ord)(salary, date, code, value)
orders(value, id, amount, salary)
Task: Find code from warehouses where a matching record exists in orders with the same type.
SQL: | SELECT code FROM warehouses AS ord
WHERE EXISTS (
SELECT 1 FROM orders AS lne
WHERE lne.type = ord.type
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_train_00436 | train | T1 |
v2 | Schema:
shipments (alias: inv)(code, status, value, date)
branches(status, type, amount, value)
Task: Find name from shipments where a matching record exists in branches with the same type.
SQL: | SELECT name FROM shipments AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS ordr
WHERE ordr.type = inv.type
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_train_00437 | train | T1 |
v3 | Schema:
products (alias: ordr)(date, code, salary, value)
tasks(id, status, level, salary)
Task: Retrieve code from products with amount above the MAX(value) of tasks rows sharing the same level.
SQL: | SELECT code FROM products AS ordr
WHERE amount > (
SELECT MAX(value) FROM tasks AS rgn
WHERE rgn.level = ordr.level
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_train_00438 | train | T2 |
v1 | Schema:
categories (alias: srvc)(type, id, value, amount)
customers(name, date, type, level)
Task: Retrieve salary from categories whose code is found in customers rows where id matches the outer record.
SQL: | SELECT salary FROM categories AS srvc
WHERE code IN (
SELECT code FROM customers AS txn
WHERE txn.id = srvc.id
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_train_00439 | train | T2 |
v1 | Schema:
invoices (alias: budg)(level, type, amount, date)
regions(salary, amount, name, status)
Task: Retrieve value from invoices whose level is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM invoices AS budg
WHERE level IN (
SELECT level FROM regions AS dept
WHERE dept.status = budg.status
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_train_00440 | train | T2 |
v2 | Schema:
tasks (alias: catg)(level, amount, id, name)
categories(name, date, salary, value)
Task: Find salary from tasks where a matching record exists in categories with the same status.
SQL: | SELECT salary FROM tasks AS catg
WHERE EXISTS (
SELECT 1 FROM categories AS txn
WHERE txn.status = catg.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_train_00441 | train | T2 |
v3 | Schema:
categories (alias: cust)(amount, level, salary, code)
branches(code, type, name, date)
Task: Find amount from categories where amount exceeds the average value from branches for the same id.
SQL: | SELECT amount FROM categories AS cust
WHERE amount > (
SELECT AVG(value) FROM branches AS ordr
WHERE ordr.id = cust.id
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_train_00442 | train | T1 |
v2 | Schema:
categories (alias: catg)(amount, level, type, date)
branches(amount, level, name, code)
Task: Find salary from categories where a matching record exists in branches with the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_train_00443 | train | T2 |
v2 | Schema:
customers (alias: emp)(level, name, value, type)
transactions(date, name, id, amount)
Task: Retrieve amount from customers that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT amount FROM customers AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_train_00444 | train | T1 |
v2 | Schema:
customers (alias: emp)(type, name, amount, salary)
transactions(salary, status, id, type)
Task: Find id from customers where a matching record exists in transactions with the same type.
SQL: | SELECT id FROM customers AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_train_00445 | train | T1 |
v2 | Schema:
suppliers (alias: shp)(status, date, name, value)
transactions(value, name, type, salary)
Task: Find id from suppliers where a matching record exists in transactions with the same level.
SQL: | SELECT id FROM suppliers AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS cust
WHERE cust.level = shp.level
); | {
"outer_table": "suppliers",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_train_00446 | train | T2 |
v3 | Schema:
tasks (alias: rgn)(amount, status, date, id)
customers(status, type, code, date)
Task: Find value from tasks where value exceeds the average salary from customers for the same code.
SQL: | SELECT value FROM tasks AS rgn
WHERE value > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_train_00447 | train | T2 |
v1 | Schema:
accounts (alias: ordr)(name, date, id, status)
suppliers(id, level, salary, date)
Task: Find value from accounts where status appears in suppliers entries with matching type.
SQL: | SELECT value FROM accounts AS ordr
WHERE status IN (
SELECT status FROM suppliers AS prod
WHERE prod.type = ordr.type
); | {
"outer_table": "accounts",
"inner_table": "suppliers",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_train_00448 | train | T2 |
v1 | Schema:
products (alias: ord)(code, value, level, type)
suppliers(amount, id, code, status)
Task: Select code from products where level exists in suppliers for the same type.
SQL: | SELECT code FROM products AS ord
WHERE level IN (
SELECT level FROM suppliers AS ordr
WHERE ordr.type = ord.type
); | {
"outer_table": "products",
"inner_table": "suppliers",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_train_00449 | train | T1 |
v3 | Schema:
suppliers (alias: acct)(name, code, amount, status)
branches(status, date, type, id)
Task: Find salary from suppliers where amount exceeds the average value from branches for the same code.
SQL: | SELECT salary FROM suppliers AS acct
WHERE amount > (
SELECT AVG(value) FROM branches AS ord
WHERE ord.code = acct.code
); | {
"outer_table": "suppliers",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_train_00450 | train | T1 |
v3 | Schema:
departments (alias: acct)(code, status, amount, date)
branches(name, salary, date, level)
Task: Retrieve value from departments with value above the MIN(salary) of branches rows sharing the same level.
SQL: | SELECT value FROM departments AS acct
WHERE value > (
SELECT MIN(salary) FROM branches AS srvc
WHERE srvc.level = acct.level
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_train_00451 | train | T1 |
v2 | Schema:
categories (alias: rgn)(type, value, amount, salary)
shipments(id, status, code, amount)
Task: Retrieve value from categories that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT value FROM categories AS rgn
WHERE EXISTS (
SELECT 1 FROM shipments AS prod
WHERE prod.status = rgn.status
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_train_00452 | train | T2 |
v1 | Schema:
orders (alias: prod)(id, type, level, code)
employees(id, name, value, salary)
Task: Find id from orders where code appears in employees entries with matching code.
SQL: | SELECT id FROM orders AS prod
WHERE code IN (
SELECT code FROM employees AS catg
WHERE catg.code = prod.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_train_00453 | train | T1 |
v3 | Schema:
tasks (alias: mgr)(type, date, status, salary)
warehouses(level, type, amount, code)
Task: Find name from tasks where salary exceeds the average amount from warehouses for the same status.
SQL: | SELECT name FROM tasks AS mgr
WHERE salary > (
SELECT COUNT(amount) FROM warehouses AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "tasks",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_train_00454 | train | T1 |
v3 | Schema:
projects (alias: emp)(id, date, level, value)
tasks(date, value, amount, type)
Task: Find value from projects where amount exceeds the average salary from tasks for the same id.
SQL: | SELECT value FROM projects AS emp
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_train_00455 | train | T1 |
v1 | Schema:
departments (alias: lne)(name, amount, level, salary)
employees(name, date, id, type)
Task: Retrieve salary from departments whose code is found in employees rows where code matches the outer record.
SQL: | SELECT salary FROM departments AS lne
WHERE code IN (
SELECT code FROM employees AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_train_00456 | train | T2 |
v1 | Schema:
suppliers (alias: rgn)(date, value, type, code)
employees(level, date, value, name)
Task: Select code from suppliers where status exists in employees for the same status.
SQL: | SELECT code FROM suppliers AS rgn
WHERE status IN (
SELECT status FROM employees AS ordr
WHERE ordr.status = rgn.status
); | {
"outer_table": "suppliers",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_train_00457 | train | T2 |
v2 | Schema:
branches (alias: rgn)(status, id, salary, code)
departments(code, date, type, name)
Task: Retrieve id from branches that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT id FROM branches AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_train_00458 | train | T2 |
v1 | Schema:
tasks (alias: mgr)(id, type, date, name)
regions(status, code, amount, id)
Task: Select id from tasks where level exists in regions for the same level.
SQL: | SELECT id FROM tasks AS mgr
WHERE level IN (
SELECT level FROM regions AS srvc
WHERE srvc.level = mgr.level
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_train_00459 | train | T1 |
v1 | Schema:
employees (alias: srvc)(date, salary, id, name)
regions(salary, id, level, name)
Task: Find amount from employees where status appears in regions entries with matching code.
SQL: | SELECT amount FROM employees AS srvc
WHERE status IN (
SELECT status FROM regions AS ord
WHERE ord.code = srvc.code
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_train_00460 | train | T2 |
v1 | Schema:
customers (alias: lne)(status, amount, level, value)
employees(status, value, salary, level)
Task: Retrieve code from customers whose id is found in employees rows where type matches the outer record.
SQL: | SELECT code FROM customers AS lne
WHERE id IN (
SELECT id FROM employees AS ordr
WHERE ordr.type = lne.type
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_train_00461 | train | T2 |
v3 | Schema:
projects (alias: mgr)(status, code, value, date)
regions(code, status, date, id)
Task: Find value from projects where value exceeds the average amount from regions for the same status.
SQL: | SELECT value FROM projects AS mgr
WHERE value > (
SELECT MAX(amount) FROM regions AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_train_00462 | train | T1 |
v1 | Schema:
transactions (alias: schd)(level, amount, code, type)
products(name, id, status, type)
Task: Select id from transactions where status exists in products for the same type.
SQL: | SELECT id FROM transactions AS schd
WHERE status IN (
SELECT status FROM products AS budg
WHERE budg.type = schd.type
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_train_00463 | train | T2 |
v3 | Schema:
suppliers (alias: lne)(id, status, name, amount)
warehouses(level, code, salary, value)
Task: Find value from suppliers where value exceeds the average amount from warehouses for the same status.
SQL: | SELECT value FROM suppliers AS lne
WHERE value > (
SELECT MIN(amount) FROM warehouses AS schd
WHERE schd.status = lne.status
); | {
"outer_table": "suppliers",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_train_00464 | train | T2 |
v3 | Schema:
projects (alias: schd)(salary, amount, name, status)
transactions(amount, value, status, id)
Task: Retrieve salary from projects with value above the SUM(value) of transactions rows sharing the same code.
SQL: | SELECT salary FROM projects AS schd
WHERE value > (
SELECT SUM(value) FROM transactions AS cust
WHERE cust.code = schd.code
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_train_00465 | train | T2 |
v2 | Schema:
suppliers (alias: whs)(status, amount, value, salary)
regions(type, code, salary, status)
Task: Find salary from suppliers where a matching record exists in regions with the same id.
SQL: | SELECT salary FROM suppliers AS whs
WHERE EXISTS (
SELECT 1 FROM regions AS shp
WHERE shp.id = whs.id
); | {
"outer_table": "suppliers",
"inner_table": "regions",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_train_00466 | train | T2 |
v1 | Schema:
departments (alias: prod)(id, date, status, name)
categories(level, status, type, code)
Task: Find amount from departments where code appears in categories entries with matching level.
SQL: | SELECT amount FROM departments AS prod
WHERE code IN (
SELECT code FROM categories AS srvc
WHERE srvc.level = prod.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_train_00467 | train | T1 |
v3 | Schema:
categories (alias: schd)(type, value, code, level)
branches(value, type, name, salary)
Task: Retrieve name from categories with value above the AVG(salary) of branches rows sharing the same code.
SQL: | SELECT name FROM categories AS schd
WHERE value > (
SELECT AVG(salary) FROM branches AS cust
WHERE cust.code = schd.code
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_train_00468 | train | T2 |
v2 | Schema:
customers (alias: schd)(amount, status, code, name)
projects(status, level, date, name)
Task: Retrieve code from customers that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT code FROM customers AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS lne
WHERE lne.status = schd.status
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_train_00469 | train | T2 |
v1 | Schema:
invoices (alias: dept)(code, value, amount, status)
suppliers(id, code, name, type)
Task: Retrieve id from invoices whose code is found in suppliers rows where level matches the outer record.
SQL: | SELECT id FROM invoices AS dept
WHERE code IN (
SELECT code FROM suppliers AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "invoices",
"inner_table": "suppliers",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_train_00470 | train | T1 |
v2 | Schema:
categories (alias: budg)(id, type, name, code)
customers(code, date, salary, value)
Task: Find name from categories where a matching record exists in customers with the same code.
SQL: | SELECT name FROM categories AS budg
WHERE EXISTS (
SELECT 1 FROM customers AS prod
WHERE prod.code = budg.code
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_train_00471 | train | T2 |
v1 | Schema:
regions (alias: cust)(value, salary, date, name)
customers(name, level, id, status)
Task: Retrieve amount from regions whose code is found in customers rows where code matches the outer record.
SQL: | SELECT amount FROM regions AS cust
WHERE code IN (
SELECT code FROM customers AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_train_00472 | train | T1 |
v3 | Schema:
accounts (alias: lne)(status, name, id, date)
products(id, date, value, type)
Task: Find value from accounts where value exceeds the average salary from products for the same level.
SQL: | SELECT value FROM accounts AS lne
WHERE value > (
SELECT AVG(salary) FROM products AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_train_00473 | train | T2 |
v1 | Schema:
shipments (alias: inv)(type, name, value, id)
warehouses(level, value, name, type)
Task: Retrieve amount from shipments whose level is found in warehouses rows where id matches the outer record.
SQL: | SELECT amount FROM shipments AS inv
WHERE level IN (
SELECT level FROM warehouses AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_train_00474 | train | T1 |
v1 | Schema:
suppliers (alias: budg)(code, level, name, salary)
invoices(name, salary, type, status)
Task: Select amount from suppliers where code exists in invoices for the same status.
SQL: | SELECT amount FROM suppliers AS budg
WHERE code IN (
SELECT code FROM invoices AS srvc
WHERE srvc.status = budg.status
); | {
"outer_table": "suppliers",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_train_00475 | train | T2 |
v1 | Schema:
invoices (alias: ordr)(name, status, amount, type)
employees(value, amount, code, name)
Task: Select salary from invoices where code exists in employees for the same status.
SQL: | SELECT salary FROM invoices AS ordr
WHERE code IN (
SELECT code FROM employees AS whs
WHERE whs.status = ordr.status
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_train_00476 | train | T2 |
v2 | Schema:
shipments (alias: whs)(id, date, code, salary)
transactions(level, date, code, value)
Task: Find code from shipments where a matching record exists in transactions with the same type.
SQL: | SELECT code FROM shipments AS whs
WHERE EXISTS (
SELECT 1 FROM transactions AS dept
WHERE dept.type = whs.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_train_00477 | train | T2 |
v3 | Schema:
customers (alias: lne)(type, name, amount, value)
employees(date, value, code, status)
Task: Find salary from customers where value exceeds the average salary from employees for the same status.
SQL: | SELECT salary FROM customers AS lne
WHERE value > (
SELECT MIN(salary) FROM employees AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_train_00478 | train | T2 |
v2 | Schema:
products (alias: sale)(status, type, level, value)
tasks(type, amount, date, value)
Task: Find salary from products where a matching record exists in tasks with the same code.
SQL: | SELECT salary FROM products AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_train_00479 | train | T1 |
v2 | Schema:
products (alias: ord)(id, amount, date, value)
departments(id, type, code, date)
Task: Find value from products where a matching record exists in departments with the same level.
SQL: | SELECT value FROM products AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_train_00480 | train | T1 |
v3 | Schema:
suppliers (alias: srvc)(status, amount, type, id)
accounts(status, level, name, salary)
Task: Find amount from suppliers where amount exceeds the average salary from accounts for the same status.
SQL: | SELECT amount FROM suppliers AS srvc
WHERE amount > (
SELECT AVG(salary) FROM accounts AS ordr
WHERE ordr.status = srvc.status
); | {
"outer_table": "suppliers",
"inner_table": "accounts",
"outer_alias": "srvc",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_train_00481 | train | T2 |
v3 | Schema:
warehouses (alias: budg)(value, type, status, code)
invoices(status, level, value, date)
Task: Retrieve amount from warehouses with value above the SUM(value) of invoices rows sharing the same type.
SQL: | SELECT amount FROM warehouses AS budg
WHERE value > (
SELECT SUM(value) FROM invoices AS txn
WHERE txn.type = budg.type
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_train_00482 | train | T2 |
v2 | Schema:
departments (alias: inv)(date, amount, level, name)
suppliers(level, name, value, status)
Task: Retrieve salary from departments that have at least one corresponding entry in suppliers sharing the same level.
SQL: | SELECT salary FROM departments AS inv
WHERE EXISTS (
SELECT 1 FROM suppliers AS prod
WHERE prod.level = inv.level
); | {
"outer_table": "departments",
"inner_table": "suppliers",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_train_00483 | train | T1 |
v2 | Schema:
accounts (alias: emp)(code, salary, type, amount)
departments(id, type, value, code)
Task: Find amount from accounts where a matching record exists in departments with the same id.
SQL: | SELECT amount FROM accounts AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_train_00484 | train | T1 |
v2 | Schema:
invoices (alias: lne)(status, name, amount, id)
products(value, level, id, name)
Task: Retrieve name from invoices that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT name FROM invoices AS lne
WHERE EXISTS (
SELECT 1 FROM products AS srvc
WHERE srvc.type = lne.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_train_00485 | train | T2 |
v3 | Schema:
transactions (alias: ord)(name, type, amount, value)
accounts(type, status, value, salary)
Task: Find code from transactions where salary exceeds the average value from accounts for the same id.
SQL: | SELECT code FROM transactions AS ord
WHERE salary > (
SELECT SUM(value) FROM accounts AS catg
WHERE catg.id = ord.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_train_00486 | train | T1 |
v3 | Schema:
invoices (alias: rgn)(value, code, date, type)
projects(id, amount, code, salary)
Task: Retrieve salary from invoices with value above the MIN(value) of projects rows sharing the same type.
SQL: | SELECT salary FROM invoices AS rgn
WHERE value > (
SELECT MIN(value) FROM projects AS acct
WHERE acct.type = rgn.type
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_train_00487 | train | T2 |
v1 | Schema:
warehouses (alias: txn)(value, name, code, id)
categories(date, level, type, code)
Task: Retrieve value from warehouses whose level is found in categories rows where code matches the outer record.
SQL: | SELECT value FROM warehouses AS txn
WHERE level IN (
SELECT level FROM categories AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "warehouses",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_train_00488 | train | T1 |
v3 | Schema:
employees (alias: prod)(status, id, name, salary)
departments(name, type, code, date)
Task: Find amount from employees where amount exceeds the average value from departments for the same code.
SQL: | SELECT amount FROM employees AS prod
WHERE amount > (
SELECT AVG(value) FROM departments AS mgr
WHERE mgr.code = prod.code
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_train_00489 | train | T1 |
v2 | Schema:
invoices (alias: mgr)(id, name, date, amount)
regions(id, salary, status, name)
Task: Retrieve salary from invoices that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT salary FROM invoices AS mgr
WHERE EXISTS (
SELECT 1 FROM regions AS sale
WHERE sale.level = mgr.level
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_train_00490 | train | T1 |
v3 | Schema:
orders (alias: txn)(code, amount, id, date)
suppliers(status, name, date, level)
Task: Find name from orders where value exceeds the average value from suppliers for the same status.
SQL: | SELECT name FROM orders AS txn
WHERE value > (
SELECT AVG(value) FROM suppliers AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "orders",
"inner_table": "suppliers",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_train_00491 | train | T1 |
v2 | Schema:
warehouses (alias: ordr)(id, status, code, name)
regions(amount, code, name, status)
Task: Retrieve name from warehouses that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT name FROM warehouses AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS empl
WHERE empl.type = ordr.type
); | {
"outer_table": "warehouses",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_train_00492 | train | T2 |
v3 | Schema:
accounts (alias: ordr)(amount, code, date, id)
orders(id, salary, amount, level)
Task: Retrieve id from accounts with value above the AVG(amount) of orders rows sharing the same id.
SQL: | SELECT id FROM accounts AS ordr
WHERE value > (
SELECT AVG(amount) FROM orders AS empl
WHERE empl.id = ordr.id
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_train_00493 | train | T2 |
v3 | Schema:
suppliers (alias: rgn)(level, type, date, name)
departments(level, salary, code, type)
Task: Retrieve amount from suppliers with value above the MAX(amount) of departments rows sharing the same code.
SQL: | SELECT amount FROM suppliers AS rgn
WHERE value > (
SELECT MAX(amount) FROM departments AS whs
WHERE whs.code = rgn.code
); | {
"outer_table": "suppliers",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_train_00494 | train | T2 |
v2 | Schema:
categories (alias: prod)(name, code, level, status)
transactions(level, type, value, code)
Task: Find salary from categories where a matching record exists in transactions with the same type.
SQL: | SELECT salary FROM categories AS prod
WHERE EXISTS (
SELECT 1 FROM transactions AS inv
WHERE inv.type = prod.type
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_train_00495 | train | T1 |
v2 | Schema:
transactions (alias: catg)(code, salary, value, date)
branches(amount, level, status, code)
Task: Retrieve code from transactions that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT code FROM transactions AS catg
WHERE EXISTS (
SELECT 1 FROM branches AS prod
WHERE prod.type = catg.type
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_train_00496 | train | T2 |
v1 | Schema:
suppliers (alias: dept)(name, value, amount, date)
products(code, value, date, salary)
Task: Find id from suppliers where type appears in products entries with matching status.
SQL: | SELECT id FROM suppliers AS dept
WHERE type IN (
SELECT type FROM products AS srvc
WHERE srvc.status = dept.status
); | {
"outer_table": "suppliers",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_train_00497 | train | T1 |
v2 | Schema:
projects (alias: sale)(value, type, name, level)
regions(date, level, type, code)
Task: Find id from projects where a matching record exists in regions with the same code.
SQL: | SELECT id FROM projects AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_train_00498 | train | T1 |
v1 | Schema:
products (alias: catg)(code, salary, id, name)
departments(salary, code, status, id)
Task: Select salary from products where code exists in departments for the same code.
SQL: | SELECT salary FROM products AS catg
WHERE code IN (
SELECT code FROM departments AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_train_00499 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.