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 |
|---|---|---|---|---|---|---|
v3 | Schema:
projects (alias: prod)(amount, salary, name, code)
employees(date, name, level, code)
Task: Find value from projects where amount exceeds the average salary from employees for the same id.
SQL: | SELECT value FROM projects AS prod
WHERE amount > (
SELECT MAX(salary) FROM employees AS schd
WHERE schd.id = prod.id
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_train_00200 | train | T1 |
v1 | Schema:
regions (alias: mgr)(name, value, type, date)
branches(code, status, type, name)
Task: Retrieve value from regions whose level is found in branches rows where code matches the outer record.
SQL: | SELECT value FROM regions AS mgr
WHERE level IN (
SELECT level FROM branches AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_train_00201 | train | T1 |
v2 | Schema:
orders (alias: dept)(name, salary, value, amount)
employees(id, status, value, code)
Task: Find salary from orders where a matching record exists in employees with the same code.
SQL: | SELECT salary 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": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_train_00202 | train | T1 |
v1 | Schema:
shipments (alias: prod)(date, amount, type, value)
tasks(id, date, type, status)
Task: Find amount from shipments where type appears in tasks entries with matching status.
SQL: | SELECT amount FROM shipments AS prod
WHERE type IN (
SELECT type FROM tasks AS inv
WHERE inv.status = prod.status
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_train_00203 | train | T1 |
v3 | Schema:
warehouses (alias: cust)(date, level, status, type)
branches(level, date, type, salary)
Task: Retrieve id from warehouses with salary above the MIN(salary) of branches rows sharing the same status.
SQL: | SELECT id FROM warehouses AS cust
WHERE salary > (
SELECT MIN(salary) FROM branches AS shp
WHERE shp.status = cust.status
); | {
"outer_table": "warehouses",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_train_00204 | train | T1 |
v1 | Schema:
suppliers (alias: catg)(date, level, status, value)
orders(type, id, date, code)
Task: Retrieve code from suppliers whose level is found in orders rows where id matches the outer record.
SQL: | SELECT code FROM suppliers AS catg
WHERE level IN (
SELECT level FROM orders AS schd
WHERE schd.id = catg.id
); | {
"outer_table": "suppliers",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_train_00205 | train | T2 |
v3 | Schema:
employees (alias: emp)(date, type, id, salary)
projects(amount, salary, code, level)
Task: Find value from employees where value exceeds the average value from projects for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MIN(value) FROM projects AS srvc
WHERE srvc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_train_00206 | train | T1 |
v2 | Schema:
transactions (alias: lne)(status, salary, id, name)
accounts(value, salary, type, level)
Task: Retrieve amount from transactions that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT amount FROM transactions AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_train_00207 | train | T2 |
v3 | Schema:
projects (alias: schd)(code, value, id, salary)
categories(salary, status, id, code)
Task: Retrieve name from projects with salary above the AVG(value) of categories rows sharing the same type.
SQL: | SELECT name FROM projects AS schd
WHERE salary > (
SELECT AVG(value) FROM categories AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_train_00208 | train | T2 |
v1 | Schema:
shipments (alias: lne)(type, code, date, amount)
products(salary, name, date, level)
Task: Find id from shipments where code appears in products entries with matching code.
SQL: | SELECT id FROM shipments AS lne
WHERE code IN (
SELECT code FROM products AS whs
WHERE whs.code = lne.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_train_00209 | train | T2 |
v2 | Schema:
shipments (alias: prod)(status, name, date, salary)
departments(name, code, type, value)
Task: Retrieve id from shipments that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT id FROM shipments AS prod
WHERE EXISTS (
SELECT 1 FROM departments AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_train_00210 | train | T1 |
v3 | Schema:
invoices (alias: cust)(type, value, salary, amount)
products(name, amount, value, code)
Task: Retrieve code from invoices with value above the SUM(salary) of products rows sharing the same id.
SQL: | SELECT code FROM invoices AS cust
WHERE value > (
SELECT SUM(salary) FROM products AS empl
WHERE empl.id = cust.id
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_train_00211 | train | T1 |
v1 | Schema:
shipments (alias: acct)(name, code, value, amount)
categories(level, status, name, date)
Task: Find id from shipments where type appears in categories entries with matching code.
SQL: | SELECT id FROM shipments AS acct
WHERE type IN (
SELECT type FROM categories AS dept
WHERE dept.code = acct.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_train_00212 | train | T1 |
v1 | Schema:
accounts (alias: lne)(salary, code, type, value)
employees(code, value, name, type)
Task: Retrieve code from accounts whose level is found in employees rows where type matches the outer record.
SQL: | SELECT code FROM accounts AS lne
WHERE level IN (
SELECT level FROM employees AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_train_00213 | train | T2 |
v1 | Schema:
products (alias: dept)(type, id, date, value)
accounts(code, type, level, id)
Task: Retrieve amount from products whose level is found in accounts rows where id matches the outer record.
SQL: | SELECT amount FROM products AS dept
WHERE level IN (
SELECT level FROM accounts AS srvc
WHERE srvc.id = dept.id
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_train_00214 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(level, name, amount, type)
branches(code, id, name, status)
Task: Find value from warehouses where a matching record exists in branches with the same code.
SQL: | SELECT value FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM branches AS prod
WHERE prod.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "branches",
"outer_alias": "whs",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_train_00215 | train | T2 |
v3 | Schema:
products (alias: prod)(code, date, type, value)
shipments(code, amount, type, name)
Task: Find id from products where value exceeds the average amount from shipments for the same type.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT AVG(amount) FROM shipments AS acct
WHERE acct.type = prod.type
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_train_00216 | train | T1 |
v1 | Schema:
regions (alias: emp)(level, id, date, value)
transactions(status, salary, code, name)
Task: Retrieve name from regions whose level is found in transactions rows where status matches the outer record.
SQL: | SELECT name FROM regions AS emp
WHERE level IN (
SELECT level FROM transactions AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_train_00217 | train | T1 |
v3 | Schema:
projects (alias: emp)(status, level, type, code)
shipments(name, id, value, type)
Task: Retrieve id from projects with salary above the MAX(amount) of shipments rows sharing the same type.
SQL: | SELECT id FROM projects AS emp
WHERE salary > (
SELECT MAX(amount) FROM shipments AS whs
WHERE whs.type = emp.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_train_00218 | train | T1 |
v3 | Schema:
shipments (alias: sale)(name, type, status, salary)
transactions(type, name, date, amount)
Task: Find salary from shipments where value exceeds the average amount from transactions for the same id.
SQL: | SELECT salary FROM shipments AS sale
WHERE value > (
SELECT COUNT(amount) FROM transactions AS mgr
WHERE mgr.id = sale.id
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_train_00219 | train | T1 |
v1 | Schema:
projects (alias: empl)(name, status, date, code)
employees(value, level, id, code)
Task: Retrieve value from projects whose code is found in employees rows where id matches the outer record.
SQL: | SELECT value FROM projects AS empl
WHERE code IN (
SELECT code FROM employees AS rgn
WHERE rgn.id = empl.id
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_train_00220 | train | T2 |
v2 | Schema:
customers (alias: budg)(salary, value, code, id)
suppliers(date, id, level, amount)
Task: Find id from customers where a matching record exists in suppliers with the same level.
SQL: | SELECT id FROM customers AS budg
WHERE EXISTS (
SELECT 1 FROM suppliers AS lne
WHERE lne.level = budg.level
); | {
"outer_table": "customers",
"inner_table": "suppliers",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_train_00221 | train | T2 |
v2 | Schema:
warehouses (alias: prod)(value, type, id, code)
accounts(level, date, status, value)
Task: Retrieve salary from warehouses that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT salary FROM warehouses AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS srvc
WHERE srvc.code = prod.code
); | {
"outer_table": "warehouses",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_train_00222 | train | T1 |
v1 | Schema:
transactions (alias: budg)(salary, date, type, name)
customers(date, status, code, salary)
Task: Find value from transactions where type appears in customers entries with matching type.
SQL: | SELECT value FROM transactions AS budg
WHERE type IN (
SELECT type FROM customers AS ord
WHERE ord.type = budg.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_train_00223 | train | T2 |
v2 | Schema:
categories (alias: shp)(salary, level, type, code)
projects(salary, code, status, date)
Task: Find name from categories where a matching record exists in projects with the same type.
SQL: | SELECT name FROM categories AS shp
WHERE EXISTS (
SELECT 1 FROM projects AS empl
WHERE empl.type = shp.type
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_train_00224 | train | T2 |
v1 | Schema:
warehouses (alias: cust)(name, code, amount, status)
shipments(code, name, date, value)
Task: Find id from warehouses where type appears in shipments entries with matching type.
SQL: | SELECT id FROM warehouses AS cust
WHERE type IN (
SELECT type FROM shipments AS empl
WHERE empl.type = cust.type
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_train_00225 | train | T1 |
v1 | Schema:
transactions (alias: ordr)(type, level, code, id)
tasks(status, id, amount, name)
Task: Find value from transactions where code appears in tasks entries with matching level.
SQL: | SELECT value FROM transactions AS ordr
WHERE code IN (
SELECT code FROM tasks AS dept
WHERE dept.level = ordr.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_train_00226 | train | T2 |
v2 | Schema:
warehouses (alias: mgr)(amount, id, name, code)
shipments(amount, salary, date, type)
Task: Find value from warehouses where a matching record exists in shipments with the same status.
SQL: | SELECT value FROM warehouses AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS dept
WHERE dept.status = mgr.status
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_train_00227 | train | T1 |
v3 | Schema:
shipments (alias: rgn)(amount, date, value, status)
orders(date, status, name, type)
Task: Retrieve salary from shipments with value above the SUM(amount) of orders rows sharing the same code.
SQL: | SELECT salary FROM shipments AS rgn
WHERE value > (
SELECT SUM(amount) FROM orders AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_train_00228 | train | T2 |
v1 | Schema:
branches (alias: shp)(amount, salary, code, type)
invoices(code, salary, status, value)
Task: Select salary from branches where code exists in invoices for the same level.
SQL: | SELECT salary FROM branches AS shp
WHERE code IN (
SELECT code FROM invoices AS prod
WHERE prod.level = shp.level
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_train_00229 | train | T2 |
v2 | Schema:
invoices (alias: rgn)(value, type, date, id)
projects(status, level, type, id)
Task: Retrieve amount from invoices that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT amount FROM invoices AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS sale
WHERE sale.code = rgn.code
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_train_00230 | train | T2 |
v1 | Schema:
tasks (alias: rgn)(amount, level, salary, name)
customers(type, date, value, level)
Task: Select name from tasks where type exists in customers for the same type.
SQL: | SELECT name FROM tasks AS rgn
WHERE type IN (
SELECT type FROM customers AS whs
WHERE whs.type = rgn.type
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_train_00231 | train | T2 |
v2 | Schema:
accounts (alias: ordr)(type, value, status, amount)
categories(level, amount, type, id)
Task: Find id from accounts where a matching record exists in categories with the same id.
SQL: | SELECT id FROM accounts AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS prod
WHERE prod.id = ordr.id
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_train_00232 | train | T2 |
v2 | Schema:
regions (alias: acct)(level, type, name, code)
departments(code, level, date, amount)
Task: Find salary from regions where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM regions AS acct
WHERE EXISTS (
SELECT 1 FROM departments AS inv
WHERE inv.id = acct.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_train_00233 | train | T1 |
v2 | Schema:
regions (alias: catg)(type, level, status, salary)
categories(code, status, name, amount)
Task: Retrieve name from regions that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT name FROM regions AS catg
WHERE EXISTS (
SELECT 1 FROM categories AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_train_00234 | train | T2 |
v1 | Schema:
categories (alias: prod)(date, type, status, name)
tasks(status, type, level, name)
Task: Select salary from categories where level exists in tasks for the same code.
SQL: | SELECT salary FROM categories AS prod
WHERE level IN (
SELECT level FROM tasks AS inv
WHERE inv.code = prod.code
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_train_00235 | train | T1 |
v2 | Schema:
departments (alias: empl)(level, type, value, date)
customers(level, type, date, status)
Task: Retrieve name from departments that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT name FROM departments AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_train_00236 | train | T2 |
v1 | Schema:
categories (alias: sale)(name, value, status, type)
branches(value, amount, status, code)
Task: Find name from categories where id appears in branches entries with matching status.
SQL: | SELECT name FROM categories AS sale
WHERE id IN (
SELECT id FROM branches AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_train_00237 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(name, date, value, salary)
products(amount, salary, name, type)
Task: Find amount from warehouses where a matching record exists in products with the same code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM products AS inv
WHERE inv.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "products",
"outer_alias": "whs",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_train_00238 | train | T2 |
v1 | Schema:
invoices (alias: sale)(name, date, status, amount)
products(value, id, code, type)
Task: Find amount from invoices where status appears in products entries with matching code.
SQL: | SELECT amount FROM invoices AS sale
WHERE status IN (
SELECT status FROM products AS lne
WHERE lne.code = sale.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_train_00239 | train | T1 |
v2 | Schema:
suppliers (alias: catg)(type, name, level, status)
tasks(id, amount, date, value)
Task: Find value from suppliers where a matching record exists in tasks with the same level.
SQL: | SELECT value FROM suppliers AS catg
WHERE EXISTS (
SELECT 1 FROM tasks AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "suppliers",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_train_00240 | train | T2 |
v2 | Schema:
tasks (alias: schd)(salary, status, id, date)
accounts(status, level, name, salary)
Task: Find name from tasks where a matching record exists in accounts with the same level.
SQL: | SELECT name FROM tasks AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS empl
WHERE empl.level = schd.level
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_train_00241 | train | T2 |
v2 | Schema:
products (alias: cust)(id, name, code, status)
projects(status, date, code, amount)
Task: Retrieve code from products that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT code FROM products AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS mgr
WHERE mgr.code = cust.code
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_train_00242 | train | T1 |
v2 | Schema:
regions (alias: rgn)(value, id, type, name)
departments(code, amount, value, salary)
Task: Find salary from regions where a matching record exists in departments with the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_train_00243 | train | T2 |
v2 | Schema:
shipments (alias: srvc)(name, date, amount, type)
regions(salary, code, date, type)
Task: Find name from shipments where a matching record exists in regions with the same id.
SQL: | SELECT name FROM shipments AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS lne
WHERE lne.id = srvc.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_train_00244 | train | T2 |
v3 | Schema:
branches (alias: schd)(value, status, name, type)
suppliers(date, level, value, amount)
Task: Find code from branches where salary exceeds the average salary from suppliers for the same level.
SQL: | SELECT code FROM branches AS schd
WHERE salary > (
SELECT COUNT(salary) FROM suppliers AS srvc
WHERE srvc.level = schd.level
); | {
"outer_table": "branches",
"inner_table": "suppliers",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_train_00245 | train | T2 |
v1 | Schema:
transactions (alias: shp)(status, code, level, amount)
customers(id, name, date, type)
Task: Retrieve code from transactions whose level is found in customers rows where code matches the outer record.
SQL: | SELECT code FROM transactions AS shp
WHERE level IN (
SELECT level FROM customers AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_train_00246 | train | T2 |
v1 | Schema:
warehouses (alias: schd)(salary, name, type, value)
orders(salary, id, status, name)
Task: Find name from warehouses where type appears in orders entries with matching id.
SQL: | SELECT name FROM warehouses AS schd
WHERE type IN (
SELECT type FROM orders AS dept
WHERE dept.id = schd.id
); | {
"outer_table": "warehouses",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_train_00247 | train | T2 |
v2 | Schema:
suppliers (alias: lne)(salary, type, date, name)
invoices(name, salary, code, date)
Task: Retrieve name from suppliers that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT name FROM suppliers AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "suppliers",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_train_00248 | train | T2 |
v3 | Schema:
transactions (alias: rgn)(type, code, id, salary)
invoices(id, salary, type, value)
Task: Find amount from transactions where value exceeds the average value from invoices for the same id.
SQL: | SELECT amount FROM transactions AS rgn
WHERE value > (
SELECT SUM(value) FROM invoices AS emp
WHERE emp.id = rgn.id
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_train_00249 | train | T2 |
v3 | Schema:
tasks (alias: mgr)(status, type, level, date)
employees(id, date, level, code)
Task: Find code from tasks where value exceeds the average value from employees for the same status.
SQL: | SELECT code FROM tasks AS mgr
WHERE value > (
SELECT AVG(value) FROM employees AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_train_00250 | train | T1 |
v2 | Schema:
branches (alias: mgr)(name, type, value, salary)
warehouses(value, type, code, status)
Task: Find name from branches where a matching record exists in warehouses with the same level.
SQL: | SELECT name FROM branches AS mgr
WHERE EXISTS (
SELECT 1 FROM warehouses AS catg
WHERE catg.level = mgr.level
); | {
"outer_table": "branches",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_train_00251 | train | T1 |
v2 | Schema:
shipments (alias: sale)(name, salary, date, value)
accounts(amount, value, code, level)
Task: Retrieve amount from shipments that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT amount FROM shipments AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_train_00252 | train | T1 |
v1 | Schema:
branches (alias: shp)(level, amount, id, type)
employees(id, salary, type, value)
Task: Retrieve code from branches whose level is found in employees rows where level matches the outer record.
SQL: | SELECT code FROM branches AS shp
WHERE level IN (
SELECT level FROM employees AS schd
WHERE schd.level = shp.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_train_00253 | train | T2 |
v3 | Schema:
shipments (alias: acct)(code, value, name, type)
departments(name, value, status, code)
Task: Find salary from shipments where value exceeds the average salary from departments for the same code.
SQL: | SELECT salary FROM shipments AS acct
WHERE value > (
SELECT SUM(salary) FROM departments AS prod
WHERE prod.code = acct.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_train_00254 | train | T1 |
v2 | Schema:
regions (alias: sale)(id, name, amount, code)
accounts(name, amount, date, type)
Task: Retrieve id from regions that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT id FROM regions AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_train_00255 | train | T1 |
v1 | Schema:
products (alias: empl)(status, amount, id, value)
invoices(date, type, level, code)
Task: Retrieve id from products whose status is found in invoices rows where id matches the outer record.
SQL: | SELECT id FROM products AS empl
WHERE status IN (
SELECT status FROM invoices AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_train_00256 | train | T2 |
v1 | Schema:
employees (alias: cust)(name, status, level, code)
regions(value, salary, amount, status)
Task: Retrieve name from employees whose level is found in regions rows where level matches the outer record.
SQL: | SELECT name FROM employees AS cust
WHERE level IN (
SELECT level FROM regions AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_train_00257 | train | T1 |
v1 | Schema:
projects (alias: emp)(type, status, salary, level)
accounts(status, date, code, salary)
Task: Find id from projects where status appears in accounts entries with matching level.
SQL: | SELECT id FROM projects AS emp
WHERE status IN (
SELECT status FROM accounts AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_train_00258 | train | T1 |
v2 | Schema:
orders (alias: lne)(date, salary, amount, name)
regions(type, name, level, salary)
Task: Find salary from orders where a matching record exists in regions with the same code.
SQL: | SELECT salary FROM orders AS lne
WHERE EXISTS (
SELECT 1 FROM regions AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_train_00259 | train | T2 |
v2 | Schema:
shipments (alias: dept)(type, status, salary, code)
accounts(type, value, date, name)
Task: Retrieve amount from shipments that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT amount FROM shipments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_train_00260 | train | T1 |
v1 | Schema:
customers (alias: txn)(date, status, salary, id)
accounts(salary, type, amount, level)
Task: Retrieve id from customers whose type is found in accounts rows where code matches the outer record.
SQL: | SELECT id FROM customers AS txn
WHERE type IN (
SELECT type FROM accounts AS lne
WHERE lne.code = txn.code
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_train_00261 | train | T1 |
v3 | Schema:
invoices (alias: whs)(value, id, level, status)
shipments(level, salary, status, id)
Task: Retrieve salary from invoices with value above the COUNT(amount) of shipments rows sharing the same type.
SQL: | SELECT salary FROM invoices AS whs
WHERE value > (
SELECT COUNT(amount) FROM shipments AS lne
WHERE lne.type = whs.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_train_00262 | train | T2 |
v2 | Schema:
suppliers (alias: inv)(value, date, status, id)
transactions(id, value, name, type)
Task: Retrieve name from suppliers that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT name FROM suppliers AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS budg
WHERE budg.type = inv.type
); | {
"outer_table": "suppliers",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_train_00263 | train | T1 |
v2 | Schema:
suppliers (alias: srvc)(level, id, salary, value)
tasks(date, name, salary, amount)
Task: Retrieve salary from suppliers that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT salary FROM suppliers AS srvc
WHERE EXISTS (
SELECT 1 FROM tasks AS shp
WHERE shp.status = srvc.status
); | {
"outer_table": "suppliers",
"inner_table": "tasks",
"outer_alias": "srvc",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_train_00264 | train | T2 |
v2 | Schema:
projects (alias: mgr)(value, status, id, amount)
tasks(code, level, id, type)
Task: Find id from projects where a matching record exists in tasks with the same type.
SQL: | SELECT id FROM projects AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS dept
WHERE dept.type = mgr.type
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_train_00265 | train | T1 |
v2 | Schema:
branches (alias: txn)(amount, name, salary, value)
shipments(salary, name, level, type)
Task: Find id from branches where a matching record exists in shipments with the same status.
SQL: | SELECT id FROM branches AS txn
WHERE EXISTS (
SELECT 1 FROM shipments AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_train_00266 | train | T1 |
v2 | Schema:
orders (alias: empl)(code, name, date, type)
transactions(id, status, type, salary)
Task: Find name from orders where a matching record exists in transactions with the same type.
SQL: | SELECT name FROM orders AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS sale
WHERE sale.type = empl.type
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_train_00267 | train | T2 |
v2 | Schema:
departments (alias: empl)(code, salary, amount, status)
customers(value, name, salary, type)
Task: Find value from departments where a matching record exists in customers with the same level.
SQL: | SELECT value FROM departments AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_train_00268 | train | T2 |
v3 | Schema:
tasks (alias: shp)(status, date, name, amount)
customers(status, amount, code, id)
Task: Retrieve code from tasks with salary above the COUNT(value) of customers rows sharing the same id.
SQL: | SELECT code FROM tasks AS shp
WHERE salary > (
SELECT COUNT(value) FROM customers AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_train_00269 | train | T2 |
v1 | Schema:
warehouses (alias: ord)(level, type, value, date)
employees(code, amount, level, value)
Task: Retrieve value from warehouses whose code is found in employees rows where type matches the outer record.
SQL: | SELECT value FROM warehouses AS ord
WHERE code IN (
SELECT code FROM employees AS shp
WHERE shp.type = ord.type
); | {
"outer_table": "warehouses",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_train_00270 | train | T1 |
v2 | Schema:
transactions (alias: emp)(value, level, status, type)
products(status, date, level, type)
Task: Retrieve amount from transactions that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT amount FROM transactions AS emp
WHERE EXISTS (
SELECT 1 FROM products AS rgn
WHERE rgn.code = emp.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_train_00271 | train | T1 |
v3 | Schema:
products (alias: cust)(code, amount, value, id)
regions(id, code, salary, amount)
Task: Find amount from products where value exceeds the average salary from regions for the same status.
SQL: | SELECT amount FROM products AS cust
WHERE value > (
SELECT MAX(salary) FROM regions AS sale
WHERE sale.status = cust.status
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_train_00272 | train | T1 |
v1 | Schema:
projects (alias: ordr)(value, date, level, status)
departments(salary, value, type, code)
Task: Select salary from projects where code exists in departments for the same status.
SQL: | SELECT salary FROM projects AS ordr
WHERE code IN (
SELECT code FROM departments AS empl
WHERE empl.status = ordr.status
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_train_00273 | train | T2 |
v3 | Schema:
regions (alias: ord)(level, code, amount, status)
categories(level, type, code, id)
Task: Find name from regions where value exceeds the average value from categories for the same code.
SQL: | SELECT name FROM regions AS ord
WHERE value > (
SELECT MIN(value) FROM categories AS inv
WHERE inv.code = ord.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_train_00274 | train | T1 |
v2 | Schema:
departments (alias: dept)(code, level, value, type)
suppliers(salary, id, value, status)
Task: Find id from departments where a matching record exists in suppliers with the same status.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM suppliers AS acct
WHERE acct.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "suppliers",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_train_00275 | train | T1 |
v3 | Schema:
tasks (alias: emp)(code, amount, value, name)
accounts(name, status, id, value)
Task: Find salary from tasks where salary exceeds the average amount from accounts for the same type.
SQL: | SELECT salary FROM tasks AS emp
WHERE salary > (
SELECT COUNT(amount) FROM accounts AS srvc
WHERE srvc.type = emp.type
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_train_00276 | train | T1 |
v3 | Schema:
departments (alias: ord)(date, amount, type, code)
warehouses(value, salary, amount, date)
Task: Retrieve name from departments with amount above the COUNT(value) of warehouses rows sharing the same level.
SQL: | SELECT name FROM departments AS ord
WHERE amount > (
SELECT COUNT(value) FROM warehouses AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_train_00277 | train | T1 |
v2 | Schema:
accounts (alias: srvc)(id, level, code, date)
employees(code, name, value, status)
Task: Find value from accounts where a matching record exists in employees with the same code.
SQL: | SELECT value FROM accounts AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS dept
WHERE dept.code = srvc.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_train_00278 | train | T2 |
v3 | Schema:
projects (alias: emp)(date, salary, amount, id)
employees(salary, date, amount, name)
Task: Retrieve name from projects with salary above the MIN(salary) of employees rows sharing the same code.
SQL: | SELECT name FROM projects AS emp
WHERE salary > (
SELECT MIN(salary) FROM employees AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_train_00279 | train | T1 |
v2 | Schema:
tasks (alias: whs)(level, value, type, amount)
departments(type, id, salary, status)
Task: Find code from tasks where a matching record exists in departments with the same type.
SQL: | SELECT code FROM tasks AS whs
WHERE EXISTS (
SELECT 1 FROM departments AS ord
WHERE ord.type = whs.type
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "whs",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_train_00280 | train | T2 |
v1 | Schema:
branches (alias: acct)(status, amount, name, value)
departments(level, salary, status, id)
Task: Retrieve value from branches whose code is found in departments rows where status matches the outer record.
SQL: | SELECT value FROM branches AS acct
WHERE code IN (
SELECT code FROM departments AS ord
WHERE ord.status = acct.status
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_train_00281 | train | T1 |
v1 | Schema:
warehouses (alias: empl)(value, amount, date, type)
customers(value, level, name, code)
Task: Retrieve salary from warehouses whose status is found in customers rows where id matches the outer record.
SQL: | SELECT salary FROM warehouses AS empl
WHERE status IN (
SELECT status FROM customers AS srvc
WHERE srvc.id = empl.id
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_train_00282 | train | T2 |
v3 | Schema:
accounts (alias: txn)(code, value, id, status)
tasks(date, code, id, value)
Task: Retrieve amount from accounts with amount above the MIN(amount) of tasks rows sharing the same status.
SQL: | SELECT amount FROM accounts AS txn
WHERE amount > (
SELECT MIN(amount) FROM tasks AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_train_00283 | train | T1 |
v2 | Schema:
employees (alias: mgr)(salary, name, id, level)
customers(code, name, type, value)
Task: Find value from employees where a matching record exists in customers with the same status.
SQL: | SELECT value FROM employees AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_train_00284 | train | T1 |
v2 | Schema:
shipments (alias: rgn)(level, status, date, salary)
invoices(level, date, code, status)
Task: Find value from shipments where a matching record exists in invoices with the same status.
SQL: | SELECT value FROM shipments AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS dept
WHERE dept.status = rgn.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_train_00285 | train | T2 |
v1 | Schema:
suppliers (alias: budg)(date, status, value, type)
branches(date, id, status, amount)
Task: Find name from suppliers where code appears in branches entries with matching id.
SQL: | SELECT name FROM suppliers AS budg
WHERE code IN (
SELECT code FROM branches AS ordr
WHERE ordr.id = budg.id
); | {
"outer_table": "suppliers",
"inner_table": "branches",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_train_00286 | train | T2 |
v2 | Schema:
invoices (alias: rgn)(level, date, amount, code)
customers(type, code, salary, id)
Task: Find value from invoices where a matching record exists in customers with the same code.
SQL: | SELECT value FROM invoices AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_train_00287 | train | T2 |
v3 | Schema:
tasks (alias: ordr)(name, level, amount, id)
shipments(date, amount, status, name)
Task: Find value from tasks where value exceeds the average salary from shipments for the same type.
SQL: | SELECT value FROM tasks AS ordr
WHERE value > (
SELECT COUNT(salary) FROM shipments AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_train_00288 | train | T2 |
v2 | Schema:
invoices (alias: srvc)(level, value, code, id)
regions(name, id, status, level)
Task: Find name from invoices where a matching record exists in regions with the same id.
SQL: | SELECT name FROM invoices AS srvc
WHERE EXISTS (
SELECT 1 FROM regions AS emp
WHERE emp.id = srvc.id
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_train_00289 | train | T2 |
v3 | Schema:
branches (alias: shp)(status, type, amount, level)
shipments(id, name, value, level)
Task: Retrieve code from branches with amount above the MAX(salary) of shipments rows sharing the same status.
SQL: | SELECT code FROM branches AS shp
WHERE amount > (
SELECT MAX(salary) FROM shipments AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_train_00290 | train | T2 |
v2 | Schema:
tasks (alias: empl)(name, salary, amount, date)
employees(value, amount, name, level)
Task: Retrieve code from tasks that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT code FROM tasks AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_train_00291 | train | T2 |
v3 | Schema:
regions (alias: budg)(code, type, amount, name)
invoices(status, name, amount, value)
Task: Find id from regions where amount exceeds the average value from invoices for the same type.
SQL: | SELECT id FROM regions AS budg
WHERE amount > (
SELECT MAX(value) FROM invoices AS ord
WHERE ord.type = budg.type
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_train_00292 | train | T2 |
v3 | Schema:
transactions (alias: ordr)(salary, name, date, id)
orders(amount, status, code, level)
Task: Retrieve id from transactions with salary above the COUNT(salary) of orders rows sharing the same id.
SQL: | SELECT id FROM transactions AS ordr
WHERE salary > (
SELECT COUNT(salary) FROM orders AS dept
WHERE dept.id = ordr.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_train_00293 | train | T2 |
v2 | Schema:
suppliers (alias: mgr)(level, id, code, value)
shipments(date, code, level, amount)
Task: Retrieve value from suppliers that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT value FROM suppliers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "suppliers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_train_00294 | train | T1 |
v3 | Schema:
categories (alias: inv)(type, name, date, level)
regions(type, code, level, status)
Task: Find value from categories where value exceeds the average amount from regions for the same type.
SQL: | SELECT value FROM categories AS inv
WHERE value > (
SELECT AVG(amount) FROM regions AS schd
WHERE schd.type = inv.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_train_00295 | train | T1 |
v2 | Schema:
orders (alias: catg)(date, type, amount, name)
products(amount, type, status, id)
Task: Retrieve amount from orders that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT amount FROM orders AS catg
WHERE EXISTS (
SELECT 1 FROM products AS shp
WHERE shp.code = catg.code
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_train_00296 | train | T2 |
v2 | Schema:
departments (alias: txn)(type, salary, level, amount)
branches(value, date, level, status)
Task: Find id from departments where a matching record exists in branches with the same level.
SQL: | SELECT id FROM departments AS txn
WHERE EXISTS (
SELECT 1 FROM branches AS srvc
WHERE srvc.level = txn.level
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_train_00297 | train | T1 |
v3 | Schema:
employees (alias: dept)(salary, id, level, type)
shipments(date, amount, level, status)
Task: Find salary from employees where value exceeds the average value from shipments for the same code.
SQL: | SELECT salary FROM employees AS dept
WHERE value > (
SELECT COUNT(value) FROM shipments AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_train_00298 | train | T1 |
v2 | Schema:
accounts (alias: lne)(type, code, name, id)
customers(date, salary, type, status)
Task: Find amount from accounts where a matching record exists in customers with the same type.
SQL: | SELECT amount FROM accounts AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS dept
WHERE dept.type = lne.type
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2"
} | cs8_train_00299 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.