variant stringclasses 3
values | prompt stringlengths 163 237 | sql stringlengths 103 143 | metadata unknown | id stringlengths 21 21 | split stringclasses 1
value | token_group stringclasses 2
values |
|---|---|---|---|---|---|---|
v1 | Schema:
regions (alias: rgn)(date, id, level, type)
items(value, code, type, salary)
Task: Retrieve code from regions whose level is found in items rows where code matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10200 | train | T2 |
v2 | Schema:
customers (alias: cust)(amount, status, type, date)
categories(code, amount, date, value)
Task: Retrieve value from customers that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_10201 | train | T1 |
v3 | Schema:
sales (alias: sale)(name, level, code, salary)
products(type, name, level, code)
Task: Find value from sales where value exceeds the average amount from products for the same code.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MAX(amount) FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10202 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(salary, id, level, code)
invoices(value, amount, name, date)
Task: Find code from warehouses where id appears in invoices entries with matching level.
SQL: | SELECT code FROM warehouses AS whs
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "invoices",
"outer_alias": "whs",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10203 | train | T2 |
v1 | Schema:
schedules (alias: schd)(salary, amount, date, code)
customers(name, date, type, level)
Task: Select code from schedules where status exists in customers for the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10204 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(code, type, name, date)
budgets(code, id, status, type)
Task: Retrieve id from warehouses with value above the SUM(salary) of budgets rows sharing the same id.
SQL: | SELECT id FROM warehouses AS whs
WHERE value > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10205 | train | T2 |
v2 | Schema:
orders (alias: ord)(amount, salary, name, code)
schedules(value, status, salary, amount)
Task: Retrieve salary from orders that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_10206 | train | T1 |
v3 | Schema:
orders (alias: ord)(amount, id, status, code)
departments(type, date, salary, status)
Task: Retrieve salary from orders with amount above the COUNT(value) of departments rows sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_10207 | train | T1 |
v2 | Schema:
orders (alias: ord)(code, id, value, type)
budgets(type, status, id, date)
Task: Find salary from orders where a matching record exists in budgets with the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_10208 | train | T1 |
v1 | Schema:
orders (alias: ord)(code, type, salary, date)
sales(type, value, name, level)
Task: Select salary from orders where level exists in sales for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_10209 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, level, status, code)
regions(type, status, amount, salary)
Task: Find value from shipments where type appears in regions entries with matching type.
SQL: | SELECT value FROM shipments AS shp
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_10210 | train | T2 |
v1 | Schema:
categories (alias: catg)(name, id, amount, salary)
accounts(date, status, value, amount)
Task: Retrieve id from categories whose level is found in accounts rows where id matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_10211 | train | T2 |
v2 | Schema:
managers (alias: mgr)(status, name, type, amount)
customers(date, code, status, type)
Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same type.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10212 | train | T1 |
v3 | Schema:
categories (alias: catg)(salary, status, code, level)
departments(name, id, code, amount)
Task: Find code from categories where salary exceeds the average value from departments for the same status.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM departments AS dept
WHERE dept.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10213 | train | T2 |
v1 | Schema:
sales (alias: sale)(id, salary, value, name)
services(status, name, id, level)
Task: Select id from sales where id exists in services for the same level.
SQL: | SELECT id FROM sales AS sale
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "services",
"outer_alias": "sale",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_10214 | train | T1 |
v1 | Schema:
invoices (alias: inv)(value, type, name, level)
warehouses(date, amount, id, name)
Task: Retrieve name from invoices whose type is found in warehouses rows where code matches the outer record.
SQL: | SELECT name FROM invoices AS inv
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "warehouses",
"outer_alias": "inv",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_10215 | train | T1 |
v2 | Schema:
staff (alias: empl)(amount, id, salary, level)
regions(salary, value, id, type)
Task: Find id from staff where a matching record exists in regions with the same id.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10216 | train | T2 |
v3 | Schema:
staff (alias: empl)(amount, type, value, code)
categories(date, salary, value, status)
Task: Find name from staff where value exceeds the average value from categories for the same code.
SQL: | SELECT name FROM staff AS empl
WHERE value > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10217 | train | T2 |
v3 | Schema:
services (alias: srvc)(value, id, status, level)
categories(amount, value, id, level)
Task: Find amount from services where value exceeds the average value from categories for the same code.
SQL: | SELECT amount FROM services AS srvc
WHERE value > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_10218 | train | T2 |
v3 | Schema:
transactions (alias: txn)(id, type, level, value)
accounts(code, type, name, level)
Task: Find value from transactions where amount exceeds the average salary from accounts for the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_10219 | train | T1 |
v1 | Schema:
accounts (alias: acct)(name, value, type, id)
services(id, status, level, amount)
Task: Retrieve value from accounts whose level is found in services rows where code matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10220 | train | T1 |
v1 | Schema:
transactions (alias: txn)(level, code, value, id)
accounts(code, amount, date, name)
Task: Find name from transactions where code appears in accounts entries with matching status.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_10221 | train | T1 |
v1 | Schema:
orders (alias: ord)(salary, type, amount, code)
budgets(code, id, status, type)
Task: Select value from orders where type exists in budgets for the same type.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM budgets AS budg
WHERE budg.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "budgets",
"outer_alias": "ord",
"inner_alias": "budg",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_10222 | train | T1 |
v3 | Schema:
managers (alias: mgr)(amount, code, type, name)
shipments(value, id, status, salary)
Task: Retrieve amount from managers with value above the SUM(amount) of shipments rows sharing the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_10223 | train | T1 |
v1 | Schema:
customers (alias: cust)(name, salary, level, code)
managers(level, type, salary, amount)
Task: Find code from customers where id appears in managers entries with matching code.
SQL: | SELECT code FROM customers AS cust
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_10224 | train | T1 |
v1 | Schema:
products (alias: prod)(salary, status, id, value)
accounts(status, date, id, value)
Task: Find id from products where code appears in accounts entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.code = prod.code
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10225 | train | T1 |
v1 | Schema:
items (alias: lne)(type, date, amount, value)
shipments(level, value, date, salary)
Task: Retrieve value from items whose code is found in shipments rows where code matches the outer record.
SQL: | SELECT value FROM items AS lne
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = lne.code
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_10226 | train | T2 |
v1 | Schema:
sales (alias: sale)(status, value, code, id)
accounts(amount, type, value, date)
Task: Retrieve salary from sales whose code is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10227 | train | T1 |
v3 | Schema:
products (alias: prod)(type, amount, value, id)
schedules(id, code, date, name)
Task: Find code from products where amount exceeds the average value from schedules for the same code.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.code = prod.code
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10228 | train | T1 |
v3 | Schema:
orders (alias: ord)(name, type, date, salary)
departments(amount, date, status, type)
Task: Retrieve name from orders with value above the SUM(value) of departments rows sharing the same type.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT SUM(value) FROM departments AS dept
WHERE dept.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_10229 | train | T1 |
v2 | Schema:
accounts (alias: acct)(date, name, value, salary)
managers(type, amount, date, status)
Task: Find code from accounts where a matching record exists in managers with the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_10230 | train | T1 |
v3 | Schema:
sales (alias: sale)(code, id, date, salary)
transactions(type, id, name, amount)
Task: Retrieve id from sales with value above the MAX(value) of transactions rows sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10231 | train | T1 |
v2 | Schema:
employees (alias: emp)(status, code, level, type)
shipments(status, salary, value, amount)
Task: Retrieve code from employees that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_10232 | train | T1 |
v1 | Schema:
budgets (alias: budg)(type, date, level, name)
items(name, value, code, type)
Task: Retrieve name from budgets whose id is found in items rows where type matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "items",
"outer_alias": "budg",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_10233 | train | T2 |
v3 | Schema:
items (alias: lne)(name, status, salary, value)
shipments(date, salary, value, level)
Task: Find salary from items where amount exceeds the average salary from shipments for the same level.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT AVG(salary) FROM shipments AS shp
WHERE shp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10234 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(status, salary, type, name)
staff(status, type, date, salary)
Task: Retrieve code from warehouses that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "staff",
"outer_alias": "whs",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10235 | train | T2 |
v2 | Schema:
transactions (alias: txn)(amount, type, code, status)
managers(value, date, amount, code)
Task: Find id from transactions where a matching record exists in managers with the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_10236 | train | T1 |
v2 | Schema:
staff (alias: empl)(name, code, level, amount)
items(status, salary, value, id)
Task: Find amount from staff where a matching record exists in items with the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_10237 | train | T2 |
v2 | Schema:
managers (alias: mgr)(type, id, salary, name)
warehouses(amount, name, date, type)
Task: Retrieve value from managers that have at least one corresponding entry in warehouses sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_10238 | train | T1 |
v3 | Schema:
accounts (alias: acct)(date, type, status, name)
warehouses(type, value, code, level)
Task: Find code from accounts where salary exceeds the average value from warehouses for the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT COUNT(value) FROM warehouses AS whs
WHERE whs.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10239 | train | T1 |
v1 | Schema:
shipments (alias: shp)(name, type, id, value)
requests(code, type, amount, status)
Task: Select amount from shipments where type exists in requests for the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_10240 | train | T2 |
v3 | Schema:
schedules (alias: schd)(id, name, value, amount)
accounts(id, value, code, level)
Task: Retrieve code from schedules with amount above the SUM(amount) of accounts rows sharing the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_10241 | train | T2 |
v2 | Schema:
accounts (alias: acct)(amount, date, salary, status)
warehouses(level, code, amount, value)
Task: Find salary from accounts where a matching record exists in warehouses with the same id.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "warehouses",
"outer_alias": "acct",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_10242 | train | T1 |
v1 | Schema:
transactions (alias: txn)(name, value, amount, status)
sales(type, code, level, date)
Task: Select name from transactions where code exists in sales for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10243 | train | T1 |
v2 | Schema:
schedules (alias: schd)(id, status, date, name)
warehouses(id, type, value, level)
Task: Find name from schedules where a matching record exists in warehouses with the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "warehouses",
"outer_alias": "schd",
"inner_alias": "whs",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10244 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, value, name, amount)
departments(code, level, status, date)
Task: Retrieve code from managers that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_10245 | train | T1 |
v3 | Schema:
shipments (alias: shp)(code, type, id, level)
accounts(name, salary, value, date)
Task: Retrieve amount from shipments with salary above the SUM(value) of accounts rows sharing the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_10246 | train | T2 |
v2 | Schema:
accounts (alias: acct)(date, name, type, id)
requests(code, amount, value, type)
Task: Find amount from accounts where a matching record exists in requests with the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_10247 | train | T1 |
v2 | Schema:
sales (alias: sale)(date, level, amount, code)
departments(date, value, name, status)
Task: Retrieve amount from sales that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_10248 | train | T1 |
v3 | Schema:
managers (alias: mgr)(date, id, name, level)
departments(value, date, level, salary)
Task: Find name from managers where salary exceeds the average value from departments for the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE salary > (
SELECT COUNT(value) FROM departments AS dept
WHERE dept.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_10249 | train | T1 |
v3 | Schema:
requests (alias: ordr)(level, name, amount, type)
orders(type, id, amount, value)
Task: Retrieve name from requests with amount above the COUNT(value) of orders rows sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2"
} | cs8_fixed_train_10250 | train | T2 |
v1 | Schema:
transactions (alias: txn)(code, name, date, type)
staff(code, type, salary, date)
Task: Retrieve amount from transactions whose code is found in staff rows where status matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_10251 | train | T1 |
v1 | Schema:
sales (alias: sale)(salary, id, date, value)
invoices(level, date, status, amount)
Task: Find value from sales where code appears in invoices entries with matching status.
SQL: | SELECT value FROM sales AS sale
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_10252 | train | T1 |
v1 | Schema:
orders (alias: ord)(level, salary, code, value)
customers(amount, name, salary, level)
Task: Select value from orders where type exists in customers for the same level.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_10253 | train | T1 |
v2 | Schema:
categories (alias: catg)(status, code, salary, name)
services(date, type, value, amount)
Task: Retrieve salary from categories that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10254 | train | T2 |
v3 | Schema:
customers (alias: cust)(salary, type, level, value)
items(name, level, status, amount)
Task: Retrieve amount from customers with salary above the SUM(amount) of items rows sharing the same status.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_10255 | train | T1 |
v3 | Schema:
departments (alias: dept)(salary, value, id, type)
customers(level, amount, id, date)
Task: Retrieve amount from departments with amount above the SUM(amount) of customers rows sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE amount > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_10256 | train | T1 |
v2 | Schema:
shipments (alias: shp)(amount, salary, id, code)
categories(name, type, amount, level)
Task: Retrieve value from shipments that have at least one corresponding entry in categories sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_10257 | train | T2 |
v1 | Schema:
requests (alias: ordr)(date, salary, level, type)
transactions(level, status, value, date)
Task: Select amount from requests where level exists in transactions for the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10258 | train | T2 |
v2 | Schema:
transactions (alias: txn)(type, value, id, level)
managers(id, date, salary, level)
Task: Retrieve name from transactions that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10259 | train | T1 |
v1 | Schema:
sales (alias: sale)(value, type, id, name)
accounts(amount, code, value, date)
Task: Find value from sales where status appears in accounts entries with matching code.
SQL: | SELECT value FROM sales AS sale
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_10260 | train | T1 |
v3 | Schema:
invoices (alias: inv)(level, name, id, value)
transactions(amount, level, type, code)
Task: Retrieve value from invoices with value above the AVG(value) of transactions rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_10261 | train | T1 |
v1 | Schema:
sales (alias: sale)(type, code, name, salary)
categories(id, code, status, type)
Task: Retrieve salary from sales whose status is found in categories rows where type matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10262 | train | T1 |
v2 | Schema:
invoices (alias: inv)(date, value, amount, salary)
managers(salary, level, id, type)
Task: Retrieve amount from invoices that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_10263 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, status, id, amount)
services(level, amount, code, name)
Task: Find salary from categories where status appears in services entries with matching id.
SQL: | SELECT salary FROM categories AS catg
WHERE status IN (
SELECT status FROM services AS srvc
WHERE srvc.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_10264 | train | T2 |
v1 | Schema:
sales (alias: sale)(date, name, amount, type)
departments(date, status, name, level)
Task: Retrieve amount from sales whose level is found in departments rows where id matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_10265 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(salary, value, name, id)
services(amount, status, code, date)
Task: Find id from warehouses where code appears in services entries with matching level.
SQL: | SELECT id FROM warehouses AS whs
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.level = whs.level
); | {
"outer_table": "warehouses",
"inner_table": "services",
"outer_alias": "whs",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "whs.level",
"token_group": "T2"
} | cs8_fixed_train_10266 | train | T2 |
v2 | Schema:
shipments (alias: shp)(salary, id, code, level)
employees(status, amount, code, id)
Task: Retrieve name from shipments that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_10267 | train | T2 |
v1 | Schema:
schedules (alias: schd)(amount, salary, level, name)
services(level, salary, type, amount)
Task: Retrieve salary from schedules whose code is found in services rows where level matches the outer record.
SQL: | SELECT salary FROM schedules AS schd
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "services",
"outer_alias": "schd",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_10268 | train | T2 |
v1 | Schema:
shipments (alias: shp)(id, amount, date, type)
regions(date, type, amount, value)
Task: Select value from shipments where id exists in regions for the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_10269 | train | T2 |
v3 | Schema:
sales (alias: sale)(date, salary, amount, level)
categories(code, amount, date, name)
Task: Find value from sales where value exceeds the average amount from categories for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10270 | train | T1 |
v2 | Schema:
orders (alias: ord)(id, code, amount, name)
requests(level, id, amount, code)
Task: Find value from orders where a matching record exists in requests with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_10271 | train | T1 |
v2 | Schema:
categories (alias: catg)(level, name, type, id)
departments(date, level, code, name)
Task: Find amount from categories where a matching record exists in departments with the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10272 | train | T2 |
v1 | Schema:
staff (alias: empl)(date, level, amount, value)
sales(type, date, status, level)
Task: Find value from staff where status appears in sales entries with matching code.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_10273 | train | T2 |
v1 | Schema:
staff (alias: empl)(name, salary, status, level)
accounts(salary, amount, status, date)
Task: Find id from staff where status appears in accounts entries with matching id.
SQL: | SELECT id FROM staff AS empl
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_10274 | train | T2 |
v3 | Schema:
warehouses (alias: whs)(name, salary, status, amount)
shipments(salary, code, value, amount)
Task: Retrieve salary from warehouses with amount above the SUM(amount) of shipments rows sharing the same id.
SQL: | SELECT salary FROM warehouses AS whs
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.id = whs.id
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "whs.id",
"token_group": "T2"
} | cs8_fixed_train_10275 | train | T2 |
v1 | Schema:
schedules (alias: schd)(amount, value, code, id)
customers(name, salary, id, type)
Task: Retrieve amount from schedules whose status is found in customers rows where status matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_10276 | train | T2 |
v3 | Schema:
customers (alias: cust)(level, type, code, id)
requests(value, code, id, date)
Task: Retrieve amount from customers with amount above the AVG(salary) of requests rows sharing the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_10277 | train | T1 |
v1 | Schema:
invoices (alias: inv)(level, amount, date, code)
departments(level, date, amount, salary)
Task: Retrieve value from invoices whose level is found in departments rows where status matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_10278 | train | T1 |
v3 | Schema:
orders (alias: ord)(code, value, type, status)
categories(level, salary, date, status)
Task: Find name from orders where amount exceeds the average amount from categories for the same level.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_10279 | train | T1 |
v3 | Schema:
items (alias: lne)(value, date, id, name)
warehouses(value, level, name, amount)
Task: Find value from items where value exceeds the average amount from warehouses for the same level.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT AVG(amount) FROM warehouses AS whs
WHERE whs.level = lne.level
); | {
"outer_table": "items",
"inner_table": "warehouses",
"outer_alias": "lne",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10280 | train | T2 |
v1 | Schema:
transactions (alias: txn)(id, status, level, name)
products(value, code, level, id)
Task: Retrieve value from transactions whose level is found in products rows where level matches the outer record.
SQL: | SELECT value FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_10281 | train | T1 |
v2 | Schema:
sales (alias: sale)(amount, code, type, level)
regions(type, status, date, salary)
Task: Find code from sales where a matching record exists in regions with the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_10282 | train | T1 |
v3 | Schema:
transactions (alias: txn)(code, value, name, date)
regions(id, status, code, amount)
Task: Retrieve id from transactions with salary above the MIN(salary) of regions rows sharing the same id.
SQL: | SELECT id FROM transactions AS txn
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_10283 | train | T1 |
v2 | Schema:
schedules (alias: schd)(level, name, status, salary)
categories(name, type, id, level)
Task: Retrieve code from schedules that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_10284 | train | T2 |
v3 | Schema:
invoices (alias: inv)(level, id, date, amount)
services(type, id, code, name)
Task: Find salary from invoices where amount exceeds the average salary from services for the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE amount > (
SELECT SUM(salary) FROM services AS srvc
WHERE srvc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "services",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_10285 | train | T1 |
v3 | Schema:
schedules (alias: schd)(status, amount, value, level)
transactions(salary, date, id, type)
Task: Retrieve salary from schedules with value above the COUNT(salary) of transactions rows sharing the same level.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_10286 | train | T2 |
v3 | Schema:
items (alias: lne)(status, code, level, id)
employees(value, id, type, date)
Task: Find salary from items where amount exceeds the average value from employees for the same level.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_10287 | train | T2 |
v3 | Schema:
regions (alias: rgn)(code, level, value, status)
services(code, type, id, level)
Task: Find name from regions where amount exceeds the average salary from services for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE amount > (
SELECT MAX(salary) FROM services AS srvc
WHERE srvc.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_10288 | train | T2 |
v2 | Schema:
categories (alias: catg)(level, salary, status, id)
customers(status, id, date, amount)
Task: Find value from categories where a matching record exists in customers with the same status.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_10289 | train | T2 |
v3 | Schema:
accounts (alias: acct)(level, status, salary, id)
shipments(salary, type, id, amount)
Task: Find id from accounts where value exceeds the average value from shipments for the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE value > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_10290 | train | T1 |
v1 | Schema:
products (alias: prod)(type, id, amount, code)
accounts(level, date, value, amount)
Task: Select name from products where type exists in accounts for the same code.
SQL: | SELECT name FROM products AS prod
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = prod.code
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_10291 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, date, code, id)
categories(status, level, id, code)
Task: Find amount from requests where a matching record exists in categories with the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_10292 | train | T2 |
v1 | Schema:
regions (alias: rgn)(code, salary, name, level)
services(status, code, level, date)
Task: Retrieve code from regions whose type is found in services rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE type IN (
SELECT type FROM services AS srvc
WHERE srvc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "services",
"outer_alias": "rgn",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_10293 | train | T2 |
v3 | Schema:
schedules (alias: schd)(value, type, date, amount)
requests(type, value, date, status)
Task: Find code from schedules where salary exceeds the average salary from requests for the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_10294 | train | T2 |
v1 | Schema:
requests (alias: ordr)(id, level, amount, name)
services(level, name, date, value)
Task: Retrieve id from requests whose id is found in services rows where id matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "services",
"outer_alias": "ordr",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_10295 | train | T2 |
v3 | Schema:
requests (alias: ordr)(value, id, type, level)
items(name, code, status, amount)
Task: Retrieve salary from requests with amount above the MIN(value) of items rows sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT MIN(value) FROM items AS lne
WHERE lne.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_10296 | train | T2 |
v2 | Schema:
regions (alias: rgn)(salary, level, name, type)
schedules(value, status, amount, level)
Task: Find id from regions where a matching record exists in schedules with the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_10297 | train | T2 |
v2 | Schema:
shipments (alias: shp)(salary, amount, level, value)
categories(amount, value, id, salary)
Task: Find name from shipments where a matching record exists in categories with the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_10298 | train | T2 |
v3 | Schema:
items (alias: lne)(name, level, date, code)
invoices(date, salary, status, value)
Task: Find amount from items where value exceeds the average amount from invoices for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.status = lne.status
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_10299 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.