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:
budgets (alias: budg)(value, type, amount, id)
schedules(date, amount, level, status)
Task: Select salary from budgets where id exists in schedules for the same code.
SQL: | SELECT salary FROM budgets AS budg
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "schedules",
"outer_alias": "budg",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_05900 | train | T2 |
v3 | Schema:
products (alias: prod)(amount, type, status, name)
services(salary, value, type, level)
Task: Find amount from products where value exceeds the average salary from services for the same level.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT SUM(salary) FROM services AS srvc
WHERE srvc.level = prod.level
); | {
"outer_table": "products",
"inner_table": "services",
"outer_alias": "prod",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_05901 | train | T1 |
v2 | Schema:
accounts (alias: acct)(name, status, salary, value)
regions(amount, type, salary, code)
Task: Retrieve id from accounts that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_05902 | train | T1 |
v1 | Schema:
managers (alias: mgr)(amount, status, id, code)
transactions(code, level, type, value)
Task: Retrieve name from managers whose level is found in transactions rows where id matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_05903 | train | T1 |
v2 | Schema:
regions (alias: rgn)(code, name, value, date)
staff(status, date, salary, type)
Task: Find name from regions where a matching record exists in staff with the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_05904 | train | T2 |
v3 | Schema:
transactions (alias: txn)(amount, id, code, type)
sales(level, id, name, salary)
Task: Retrieve salary from transactions with salary above the MAX(value) of sales rows sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE salary > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_05905 | train | T1 |
v1 | Schema:
budgets (alias: budg)(name, value, status, type)
invoices(level, amount, value, salary)
Task: Retrieve value from budgets whose id is found in invoices rows where type matches the outer record.
SQL: | SELECT value FROM budgets AS budg
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_05906 | train | T2 |
v2 | Schema:
requests (alias: ordr)(value, level, salary, type)
customers(value, date, name, level)
Task: Retrieve amount from requests that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_05907 | train | T2 |
v2 | Schema:
items (alias: lne)(id, type, value, code)
sales(type, date, amount, name)
Task: Find id from items where a matching record exists in sales with the same code.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_05908 | train | T2 |
v3 | Schema:
regions (alias: rgn)(value, name, type, level)
invoices(value, type, name, amount)
Task: Retrieve code from regions with value above the SUM(value) of invoices rows sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_05909 | train | T2 |
v1 | Schema:
items (alias: lne)(status, date, code, level)
managers(value, name, amount, code)
Task: Select id from items where type exists in managers for the same code.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_05910 | train | T2 |
v3 | Schema:
accounts (alias: acct)(date, name, status, id)
employees(value, salary, name, date)
Task: Find code from accounts where value exceeds the average salary from employees for the same id.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_05911 | train | T1 |
v2 | Schema:
customers (alias: cust)(value, salary, id, code)
employees(type, amount, salary, date)
Task: Retrieve id from customers that have at least one corresponding entry in employees sharing the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_05912 | train | T1 |
v2 | Schema:
managers (alias: mgr)(amount, code, level, value)
items(salary, amount, code, type)
Task: Retrieve id from managers that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_05913 | train | T1 |
v3 | Schema:
invoices (alias: inv)(id, date, amount, code)
shipments(date, amount, code, status)
Task: Find salary from invoices where value exceeds the average value from shipments for the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_05914 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, name, status, date)
accounts(type, level, status, value)
Task: Find code from shipments where id appears in accounts entries with matching id.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_05915 | train | T2 |
v3 | Schema:
shipments (alias: shp)(value, name, level, id)
departments(amount, date, level, status)
Task: Retrieve salary from shipments with value above the MIN(salary) of departments rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_05916 | train | T2 |
v2 | Schema:
employees (alias: emp)(name, code, status, salary)
customers(name, id, date, value)
Task: Find name from employees where a matching record exists in customers with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_05917 | train | T1 |
v2 | Schema:
services (alias: srvc)(amount, value, code, salary)
invoices(name, amount, status, type)
Task: Find id from services where a matching record exists in invoices with the same id.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "invoices",
"outer_alias": "srvc",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_05918 | train | T2 |
v1 | Schema:
transactions (alias: txn)(level, name, date, id)
budgets(id, date, type, name)
Task: Select name from transactions where id exists in budgets for the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "budgets",
"outer_alias": "txn",
"inner_alias": "budg",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_05919 | train | T1 |
v3 | Schema:
services (alias: srvc)(level, id, amount, salary)
customers(code, value, name, id)
Task: Retrieve salary from services with amount above the MIN(amount) of customers rows sharing the same status.
SQL: | SELECT salary FROM services AS srvc
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "customers",
"outer_alias": "srvc",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_05920 | train | T2 |
v3 | Schema:
regions (alias: rgn)(value, salary, type, date)
shipments(level, value, type, code)
Task: Retrieve amount from regions with value above the COUNT(salary) of shipments rows sharing the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_05921 | train | T2 |
v3 | Schema:
items (alias: lne)(level, name, type, value)
requests(amount, code, level, type)
Task: Retrieve code from items with amount above the MAX(amount) of requests rows sharing the same code.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_05922 | train | T2 |
v3 | Schema:
items (alias: lne)(type, id, date, value)
products(level, date, id, salary)
Task: Find amount from items where value exceeds the average value from products for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE value > (
SELECT MIN(value) FROM products AS prod
WHERE prod.status = lne.status
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_05923 | train | T2 |
v2 | Schema:
customers (alias: cust)(date, value, name, type)
sales(date, level, status, id)
Task: Retrieve salary from customers that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_05924 | train | T1 |
v3 | Schema:
transactions (alias: txn)(level, date, amount, status)
departments(code, type, value, name)
Task: Retrieve code from transactions with salary above the MAX(salary) of departments rows sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE salary > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_05925 | train | T1 |
v2 | Schema:
requests (alias: ordr)(level, salary, id, date)
customers(salary, level, code, id)
Task: Retrieve value from requests that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_05926 | train | T2 |
v1 | Schema:
departments (alias: dept)(value, code, status, date)
regions(name, code, amount, level)
Task: Find amount from departments where id appears in regions entries with matching id.
SQL: | SELECT amount FROM departments AS dept
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_05927 | train | T1 |
v1 | Schema:
invoices (alias: inv)(name, date, code, level)
employees(status, salary, type, code)
Task: Find value from invoices where id appears in employees entries with matching id.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_05928 | train | T1 |
v1 | Schema:
customers (alias: cust)(type, status, date, level)
categories(id, salary, date, code)
Task: Select name from customers where level exists in categories for the same id.
SQL: | SELECT name FROM customers AS cust
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_05929 | train | T1 |
v2 | Schema:
items (alias: lne)(type, value, amount, date)
requests(level, value, salary, status)
Task: Retrieve code from items that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_05930 | train | T2 |
v2 | Schema:
requests (alias: ordr)(date, id, code, status)
categories(code, id, status, salary)
Task: Retrieve salary from requests that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_05931 | train | T2 |
v3 | Schema:
budgets (alias: budg)(value, id, date, salary)
transactions(name, amount, value, salary)
Task: Find name from budgets where amount exceeds the average amount from transactions for the same status.
SQL: | SELECT name FROM budgets AS budg
WHERE amount > (
SELECT SUM(amount) FROM transactions AS txn
WHERE txn.status = budg.status
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "budg.status",
"token_group": "T2"
} | cs8_fixed_train_05932 | train | T2 |
v1 | Schema:
customers (alias: cust)(code, level, status, date)
staff(status, name, salary, value)
Task: Select salary from customers where id exists in staff for the same level.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_05933 | train | T1 |
v3 | Schema:
staff (alias: empl)(name, salary, value, level)
accounts(name, status, date, salary)
Task: Retrieve id from staff with salary above the SUM(value) of accounts rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT SUM(value) 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": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_05934 | train | T2 |
v3 | Schema:
categories (alias: catg)(level, id, code, type)
invoices(level, date, type, id)
Task: Retrieve amount from categories with amount above the AVG(amount) of invoices rows sharing the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_05935 | train | T2 |
v3 | Schema:
sales (alias: sale)(code, value, amount, name)
departments(level, id, value, salary)
Task: Find value from sales where amount exceeds the average amount from departments for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE amount > (
SELECT MIN(amount) FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_05936 | train | T1 |
v2 | Schema:
categories (alias: catg)(type, name, amount, level)
items(level, status, value, id)
Task: Find id from categories where a matching record exists in items with the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_05937 | train | T2 |
v1 | Schema:
employees (alias: emp)(level, code, salary, status)
warehouses(salary, name, level, value)
Task: Select name from employees where code exists in warehouses for the same code.
SQL: | SELECT name FROM employees AS emp
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "warehouses",
"outer_alias": "emp",
"inner_alias": "whs",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_05938 | train | T1 |
v2 | Schema:
schedules (alias: schd)(amount, date, status, name)
employees(amount, salary, value, code)
Task: Find value from schedules where a matching record exists in employees with the same status.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_05939 | train | T2 |
v2 | Schema:
managers (alias: mgr)(id, level, date, name)
orders(status, id, type, code)
Task: Find amount from managers where a matching record exists in orders with the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_05940 | train | T1 |
v2 | Schema:
transactions (alias: txn)(amount, salary, date, id)
requests(name, level, type, salary)
Task: Retrieve value from transactions that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_05941 | train | T1 |
v2 | Schema:
transactions (alias: txn)(salary, amount, level, status)
invoices(name, date, level, id)
Task: Retrieve code from transactions that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_05942 | train | T1 |
v2 | Schema:
customers (alias: cust)(date, level, name, code)
requests(salary, amount, level, name)
Task: Find amount from customers where a matching record exists in requests with the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_05943 | train | T1 |
v2 | Schema:
departments (alias: dept)(amount, level, value, code)
schedules(amount, type, salary, code)
Task: Find value from departments where a matching record exists in schedules with the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_05944 | train | T1 |
v3 | Schema:
staff (alias: empl)(id, code, value, status)
warehouses(id, code, salary, level)
Task: Retrieve salary from staff with amount above the MIN(value) of warehouses rows sharing the same status.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT MIN(value) FROM warehouses AS whs
WHERE whs.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_05945 | train | T2 |
v2 | Schema:
requests (alias: ordr)(status, salary, code, id)
categories(date, amount, 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_05946 | train | T2 |
v2 | Schema:
managers (alias: mgr)(name, type, amount, date)
sales(name, amount, salary, id)
Task: Find name from managers where a matching record exists in sales with the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_05947 | train | T1 |
v3 | Schema:
employees (alias: emp)(id, amount, salary, value)
orders(amount, level, status, value)
Task: Find salary from employees where value exceeds the average value from orders for the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_05948 | train | T1 |
v3 | Schema:
requests (alias: ordr)(salary, value, type, amount)
accounts(date, type, name, code)
Task: Find id from requests where salary exceeds the average salary from accounts for the same id.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_05949 | train | T2 |
v1 | Schema:
invoices (alias: inv)(id, status, date, amount)
orders(date, salary, amount, type)
Task: Select id from invoices where status exists in orders for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_05950 | train | T1 |
v1 | Schema:
staff (alias: empl)(status, salary, code, type)
invoices(amount, status, type, date)
Task: Retrieve amount from staff whose code is found in invoices rows where id matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "invoices",
"outer_alias": "empl",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_05951 | train | T2 |
v2 | Schema:
employees (alias: emp)(code, value, name, salary)
managers(date, id, status, level)
Task: Find code from employees where a matching record exists in managers with the same status.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_05952 | train | T1 |
v2 | Schema:
sales (alias: sale)(code, type, status, amount)
invoices(type, amount, salary, date)
Task: Retrieve amount from sales that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_05953 | train | T1 |
v3 | Schema:
staff (alias: empl)(name, type, salary, value)
sales(id, value, date, code)
Task: Find amount from staff where value exceeds the average salary from sales for the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT AVG(salary) FROM sales AS sale
WHERE sale.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_05954 | train | T2 |
v1 | Schema:
products (alias: prod)(salary, id, type, level)
customers(salary, code, date, name)
Task: Select name from products where id exists in customers for the same level.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = prod.level
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_05955 | train | T1 |
v1 | Schema:
staff (alias: empl)(amount, id, date, name)
warehouses(code, status, amount, level)
Task: Retrieve amount from staff whose status is found in warehouses rows where level matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "warehouses",
"outer_alias": "empl",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_05956 | train | T2 |
v1 | Schema:
orders (alias: ord)(status, amount, date, level)
managers(name, level, id, date)
Task: Find value from orders where level appears in managers entries with matching level.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_05957 | train | T1 |
v3 | Schema:
products (alias: prod)(name, salary, code, level)
staff(value, id, code, status)
Task: Find code from products where salary exceeds the average value from staff for the same level.
SQL: | SELECT code FROM products AS prod
WHERE salary > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.level = prod.level
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_05958 | train | T1 |
v3 | Schema:
orders (alias: ord)(id, status, amount, date)
transactions(level, value, amount, type)
Task: Find code from orders where value exceeds the average salary from transactions for the same id.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_05959 | train | T1 |
v3 | Schema:
transactions (alias: txn)(level, id, code, salary)
managers(name, value, salary, level)
Task: Find value from transactions where salary exceeds the average amount from managers for the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_05960 | train | T1 |
v3 | Schema:
customers (alias: cust)(amount, code, name, salary)
services(value, level, id, date)
Task: Find amount from customers where salary exceeds the average salary from services for the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM services AS srvc
WHERE srvc.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_05961 | train | T1 |
v1 | Schema:
employees (alias: emp)(value, amount, status, type)
services(code, value, salary, level)
Task: Retrieve salary from employees whose code is found in services rows where level matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "services",
"outer_alias": "emp",
"inner_alias": "srvc",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_05962 | train | T1 |
v1 | Schema:
budgets (alias: budg)(date, salary, value, id)
sales(value, type, date, name)
Task: Select value from budgets where level exists in sales for the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_05963 | train | T2 |
v3 | Schema:
shipments (alias: shp)(type, value, id, name)
employees(status, name, amount, code)
Task: Retrieve amount from shipments with value above the SUM(value) of employees rows sharing the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_05964 | train | T2 |
v1 | Schema:
managers (alias: mgr)(type, id, code, date)
requests(id, name, date, value)
Task: Find value from managers where status appears in requests entries with matching level.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_05965 | train | T1 |
v1 | Schema:
employees (alias: emp)(name, id, amount, type)
schedules(value, code, level, type)
Task: Select id from employees where type exists in schedules for the same code.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_05966 | train | T1 |
v1 | Schema:
schedules (alias: schd)(status, value, type, salary)
managers(value, status, salary, type)
Task: Retrieve amount from schedules whose id is found in managers rows where code matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_05967 | train | T2 |
v3 | Schema:
products (alias: prod)(name, code, amount, level)
regions(date, salary, type, id)
Task: Retrieve amount from products with value above the AVG(salary) of regions rows sharing the same level.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_05968 | train | T1 |
v3 | Schema:
sales (alias: sale)(type, level, status, name)
staff(name, salary, date, id)
Task: Find value from sales where salary exceeds the average salary from staff for the same code.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1"
} | cs8_fixed_train_05969 | train | T1 |
v3 | Schema:
requests (alias: ordr)(status, name, code, salary)
shipments(amount, value, salary, code)
Task: Find value from requests where amount exceeds the average amount from shipments for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2"
} | cs8_fixed_train_05970 | train | T2 |
v3 | Schema:
managers (alias: mgr)(code, value, type, date)
budgets(code, status, date, id)
Task: Retrieve salary from managers with salary above the SUM(salary) of budgets rows sharing the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT SUM(salary) FROM budgets AS budg
WHERE budg.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "budgets",
"outer_alias": "mgr",
"inner_alias": "budg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_05971 | train | T1 |
v3 | Schema:
managers (alias: mgr)(type, status, name, id)
requests(salary, type, level, amount)
Task: Find id from managers where value exceeds the average salary from requests for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1"
} | cs8_fixed_train_05972 | train | T1 |
v2 | Schema:
invoices (alias: inv)(salary, code, date, type)
services(amount, level, salary, code)
Task: Find amount from invoices where a matching record exists in services with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "services",
"outer_alias": "inv",
"inner_alias": "srvc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_05973 | train | T1 |
v2 | Schema:
transactions (alias: txn)(date, type, name, amount)
schedules(level, amount, type, date)
Task: Find id from transactions where a matching record exists in schedules with the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_05974 | train | T1 |
v1 | Schema:
employees (alias: emp)(status, value, name, level)
managers(id, salary, name, date)
Task: Find salary from employees where level appears in managers entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_05975 | train | T1 |
v2 | Schema:
categories (alias: catg)(code, id, value, salary)
services(level, date, status, salary)
Task: Retrieve code from categories that have at least one corresponding entry in services sharing the same status.
SQL: | SELECT code 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": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_05976 | train | T2 |
v2 | Schema:
items (alias: lne)(name, status, level, value)
customers(amount, id, value, status)
Task: Retrieve salary from items that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = lne.level
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2"
} | cs8_fixed_train_05977 | train | T2 |
v1 | Schema:
transactions (alias: txn)(status, salary, value, amount)
products(code, status, id, value)
Task: Select code from transactions where level exists in products for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_05978 | train | T1 |
v1 | Schema:
services (alias: srvc)(code, level, type, status)
regions(type, amount, id, date)
Task: Find salary from services where status appears in regions entries with matching type.
SQL: | SELECT salary FROM services AS srvc
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "regions",
"outer_alias": "srvc",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_05979 | train | T2 |
v2 | Schema:
requests (alias: ordr)(code, date, status, salary)
shipments(level, amount, name, type)
Task: Find value from requests where a matching record exists in shipments with the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2"
} | cs8_fixed_train_05980 | train | T2 |
v2 | Schema:
transactions (alias: txn)(date, amount, value, code)
invoices(level, code, amount, type)
Task: Find amount from transactions where a matching record exists in invoices with the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_05981 | train | T1 |
v3 | Schema:
customers (alias: cust)(salary, level, name, amount)
sales(level, salary, id, value)
Task: Retrieve name from customers with amount above the SUM(salary) of sales rows sharing the same id.
SQL: | SELECT name FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_05982 | train | T1 |
v3 | Schema:
regions (alias: rgn)(type, salary, value, name)
warehouses(id, salary, date, status)
Task: Find id from regions where salary exceeds the average amount from warehouses for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT SUM(amount) FROM warehouses AS whs
WHERE whs.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "warehouses",
"outer_alias": "rgn",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2"
} | cs8_fixed_train_05983 | train | T2 |
v2 | Schema:
sales (alias: sale)(value, id, name, date)
items(amount, name, level, code)
Task: Find amount from sales where a matching record exists in items with the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_05984 | train | T1 |
v3 | Schema:
managers (alias: mgr)(status, level, type, salary)
accounts(status, type, value, salary)
Task: Retrieve code from managers with value above the MAX(amount) of accounts rows sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_05985 | train | T1 |
v2 | Schema:
services (alias: srvc)(value, code, level, id)
warehouses(amount, id, level, status)
Task: Retrieve id from services that have at least one corresponding entry in warehouses sharing the same id.
SQL: | SELECT id FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_05986 | train | T2 |
v3 | Schema:
budgets (alias: budg)(value, amount, id, name)
sales(status, date, type, value)
Task: Retrieve code from budgets with salary above the COUNT(amount) of sales rows sharing the same level.
SQL: | SELECT code FROM budgets AS budg
WHERE salary > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_05987 | train | T2 |
v1 | Schema:
customers (alias: cust)(status, amount, type, date)
products(date, id, value, status)
Task: Find code from customers where status appears in products entries with matching id.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1"
} | cs8_fixed_train_05988 | train | T1 |
v1 | Schema:
schedules (alias: schd)(date, status, code, amount)
transactions(type, amount, name, code)
Task: Select code from schedules where code exists in transactions for the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2"
} | cs8_fixed_train_05989 | train | T2 |
v3 | Schema:
regions (alias: rgn)(code, date, value, type)
items(name, type, amount, date)
Task: Retrieve value from regions with value above the COUNT(value) of items rows sharing the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_05990 | train | T2 |
v3 | Schema:
managers (alias: mgr)(date, salary, level, status)
sales(value, name, code, status)
Task: Find amount from managers where value exceeds the average amount from sales for the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_05991 | train | T1 |
v3 | Schema:
invoices (alias: inv)(date, id, salary, amount)
staff(name, id, amount, salary)
Task: Find amount from invoices where value exceeds the average value from staff for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MAX(value) FROM staff AS empl
WHERE empl.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_05992 | train | T1 |
v1 | Schema:
staff (alias: empl)(level, amount, value, type)
departments(date, amount, status, id)
Task: Find value from staff where id appears in departments entries with matching code.
SQL: | SELECT value FROM staff AS empl
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_05993 | train | T2 |
v3 | Schema:
employees (alias: emp)(id, name, date, level)
orders(code, date, type, amount)
Task: Find code from employees where value exceeds the average salary from orders for the same id.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_05994 | train | T1 |
v2 | Schema:
transactions (alias: txn)(level, id, status, salary)
accounts(code, status, amount, level)
Task: Find value from transactions where a matching record exists in accounts with the same level.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_05995 | train | T1 |
v2 | Schema:
products (alias: prod)(salary, value, id, name)
employees(date, salary, level, id)
Task: Retrieve code from products that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = prod.type
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_05996 | train | T1 |
v3 | Schema:
managers (alias: mgr)(name, amount, type, value)
categories(level, type, status, salary)
Task: Retrieve id from managers with value above the MIN(amount) of categories rows sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_05997 | train | T1 |
v1 | Schema:
departments (alias: dept)(value, id, date, amount)
requests(value, id, level, salary)
Task: Retrieve value from departments whose code is found in requests rows where type matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_05998 | train | T1 |
v1 | Schema:
schedules (alias: schd)(name, type, salary, level)
transactions(date, level, salary, status)
Task: Find code from schedules where status appears in transactions entries with matching id.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_05999 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.