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 |
|---|---|---|---|---|---|---|
v3 | Schema:
schedules (alias: schd)(name, status, id, value)
regions(salary, level, name, amount)
Task: Retrieve salary from schedules with amount above the SUM(value) of regions rows sharing the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11900 | train | T2 |
v3 | Schema:
products (alias: prod)(salary, id, date, status)
sales(code, type, level, value)
Task: Find id from products where salary exceeds the average value from sales for the same code.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_11901 | train | T1 |
v1 | Schema:
requests (alias: ordr)(name, date, status, code)
warehouses(name, status, salary, type)
Task: Retrieve value from requests whose id is found in warehouses rows where code matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "warehouses",
"outer_alias": "ordr",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11902 | train | T2 |
v3 | Schema:
schedules (alias: schd)(status, level, amount, type)
requests(code, level, id, amount)
Task: Find name from schedules where salary exceeds the average amount from requests for the same id.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11903 | train | T2 |
v2 | Schema:
budgets (alias: budg)(date, level, value, code)
sales(id, level, code, status)
Task: Retrieve value from budgets that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT value FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_11904 | train | T2 |
v2 | Schema:
departments (alias: dept)(date, salary, type, level)
employees(salary, code, name, id)
Task: Retrieve value from departments that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_11905 | train | T1 |
v2 | Schema:
shipments (alias: shp)(salary, type, value, status)
warehouses(value, status, salary, id)
Task: Retrieve value from shipments that have at least one corresponding entry in warehouses sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "warehouses",
"outer_alias": "shp",
"inner_alias": "whs",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_11906 | train | T2 |
v2 | Schema:
regions (alias: rgn)(status, type, name, code)
staff(id, date, name, level)
Task: Find amount from regions where a matching record exists in staff with the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_11907 | train | T2 |
v2 | Schema:
orders (alias: ord)(date, name, level, salary)
staff(amount, name, code, date)
Task: Find code from orders where a matching record exists in staff with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_11908 | train | T1 |
v3 | Schema:
customers (alias: cust)(id, name, code, date)
categories(level, status, date, id)
Task: Find name from customers where salary exceeds the average amount from categories for the same code.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11909 | train | T1 |
v2 | Schema:
staff (alias: empl)(date, status, level, value)
services(date, level, status, id)
Task: Retrieve name from staff that have at least one corresponding entry in services sharing the same id.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2"
} | cs8_fixed_train_11910 | train | T2 |
v3 | Schema:
orders (alias: ord)(type, name, date, amount)
items(amount, salary, value, code)
Task: Retrieve salary from orders with salary above the SUM(amount) of items rows sharing the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_11911 | train | T1 |
v2 | Schema:
budgets (alias: budg)(code, value, type, id)
invoices(salary, status, amount, value)
Task: Find salary from budgets where a matching record exists in invoices with the same code.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "invoices",
"outer_alias": "budg",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_11912 | train | T2 |
v2 | Schema:
categories (alias: catg)(salary, code, level, value)
regions(code, id, type, value)
Task: Retrieve salary from categories that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "regions",
"outer_alias": "catg",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_11913 | train | T2 |
v3 | Schema:
invoices (alias: inv)(id, salary, type, value)
products(value, salary, date, id)
Task: Retrieve code from invoices with salary above the AVG(salary) of products rows sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT AVG(salary) FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_11914 | train | T1 |
v3 | Schema:
budgets (alias: budg)(amount, status, type, date)
departments(status, amount, code, level)
Task: Find name from budgets where salary exceeds the average amount from departments for the same code.
SQL: | SELECT name FROM budgets AS budg
WHERE salary > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "departments",
"outer_alias": "budg",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_11915 | train | T2 |
v2 | Schema:
schedules (alias: schd)(id, code, name, type)
shipments(type, date, amount, value)
Task: Retrieve id from schedules that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_11916 | train | T2 |
v1 | Schema:
services (alias: srvc)(salary, id, level, name)
managers(id, salary, value, level)
Task: Find amount from services where level appears in managers entries with matching id.
SQL: | SELECT amount FROM services AS srvc
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_11917 | train | T2 |
v1 | Schema:
departments (alias: dept)(type, salary, code, amount)
managers(status, name, code, value)
Task: Retrieve id from departments whose status is found in managers rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11918 | train | T1 |
v1 | Schema:
schedules (alias: schd)(amount, id, name, date)
transactions(code, level, value, id)
Task: Retrieve value from schedules whose type is found in transactions rows where id matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11919 | train | T2 |
v3 | Schema:
products (alias: prod)(date, level, status, code)
regions(value, code, amount, type)
Task: Find value from products where amount exceeds the average salary from regions for the same id.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_11920 | train | T1 |
v3 | Schema:
sales (alias: sale)(status, name, amount, level)
staff(salary, status, name, code)
Task: Find amount from sales where value exceeds the average value from staff for the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE value > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11921 | train | T1 |
v1 | Schema:
shipments (alias: shp)(salary, type, date, id)
schedules(level, value, amount, id)
Task: Select amount from shipments where level exists in schedules for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_11922 | train | T2 |
v2 | Schema:
orders (alias: ord)(code, level, id, type)
customers(amount, salary, type, value)
Task: Retrieve salary from orders that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_11923 | train | T1 |
v3 | Schema:
sales (alias: sale)(name, type, date, salary)
accounts(date, type, salary, name)
Task: Retrieve amount from sales with salary above the COUNT(amount) of accounts rows sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11924 | train | T1 |
v2 | Schema:
budgets (alias: budg)(date, salary, name, value)
transactions(date, status, value, salary)
Task: Retrieve salary from budgets that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT salary FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_11925 | train | T2 |
v2 | Schema:
regions (alias: rgn)(code, type, name, value)
products(value, status, name, amount)
Task: Find id from regions where a matching record exists in products with the same type.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_11926 | train | T2 |
v2 | Schema:
departments (alias: dept)(code, amount, status, date)
budgets(level, value, code, salary)
Task: Find code from departments where a matching record exists in budgets with the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "budgets",
"outer_alias": "dept",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_11927 | train | T1 |
v2 | Schema:
shipments (alias: shp)(level, salary, value, date)
schedules(type, level, status, salary)
Task: Find name from shipments where a matching record exists in schedules with the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2"
} | cs8_fixed_train_11928 | train | T2 |
v3 | Schema:
transactions (alias: txn)(id, salary, value, type)
departments(date, value, type, name)
Task: Retrieve name from transactions with value above the MIN(salary) of departments rows sharing the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_11929 | train | T1 |
v2 | Schema:
customers (alias: cust)(name, type, code, id)
invoices(code, id, amount, name)
Task: Find name from customers where a matching record exists in invoices with the same code.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11930 | train | T1 |
v1 | Schema:
transactions (alias: txn)(date, value, name, code)
warehouses(code, type, value, salary)
Task: Select value from transactions where code exists in warehouses for the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE code IN (
SELECT code FROM warehouses AS whs
WHERE whs.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_11931 | train | T1 |
v3 | Schema:
departments (alias: dept)(salary, name, amount, code)
staff(salary, date, name, amount)
Task: Find value from departments where value exceeds the average value from staff for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_11932 | train | T1 |
v1 | Schema:
customers (alias: cust)(name, salary, type, level)
sales(salary, code, value, type)
Task: Select salary from customers where type exists in sales for the same code.
SQL: | SELECT salary FROM customers AS cust
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11933 | train | T1 |
v1 | Schema:
schedules (alias: schd)(amount, level, code, status)
items(salary, code, status, name)
Task: Retrieve id from schedules whose id is found in items rows where id matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "items",
"outer_alias": "schd",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11934 | train | T2 |
v1 | Schema:
invoices (alias: inv)(status, code, amount, salary)
staff(level, name, date, amount)
Task: Select code from invoices where status exists in staff for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_11935 | train | T1 |
v3 | Schema:
invoices (alias: inv)(salary, date, type, code)
shipments(level, amount, value, code)
Task: Retrieve amount from invoices with salary above the MIN(salary) of shipments rows sharing the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1"
} | cs8_fixed_train_11936 | train | T1 |
v1 | Schema:
services (alias: srvc)(code, date, status, value)
products(status, name, salary, type)
Task: Find id from services where level appears in products entries with matching level.
SQL: | SELECT id FROM services AS srvc
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "products",
"outer_alias": "srvc",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_11937 | train | T2 |
v1 | Schema:
products (alias: prod)(name, code, status, level)
customers(level, id, name, amount)
Task: Find id from products where id appears in customers entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_11938 | train | T1 |
v3 | Schema:
requests (alias: ordr)(value, id, name, status)
invoices(value, amount, id, type)
Task: Find value from requests where amount exceeds the average value from invoices for the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11939 | train | T2 |
v3 | Schema:
sales (alias: sale)(code, salary, level, type)
invoices(code, date, salary, level)
Task: Retrieve amount from sales with salary above the SUM(salary) of invoices rows sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11940 | train | T1 |
v3 | Schema:
categories (alias: catg)(id, type, date, name)
services(id, value, code, level)
Task: Retrieve amount from categories with salary above the AVG(salary) of services rows sharing the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE salary > (
SELECT AVG(salary) FROM services AS srvc
WHERE srvc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "services",
"outer_alias": "catg",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2"
} | cs8_fixed_train_11941 | train | T2 |
v1 | Schema:
budgets (alias: budg)(status, id, type, name)
shipments(type, value, code, name)
Task: Find id from budgets where status appears in shipments entries with matching type.
SQL: | SELECT id FROM budgets AS budg
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_11942 | train | T2 |
v1 | Schema:
accounts (alias: acct)(date, type, code, level)
services(id, level, type, amount)
Task: Find id from accounts where level appears in services entries with matching level.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM services AS srvc
WHERE srvc.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "services",
"outer_alias": "acct",
"inner_alias": "srvc",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1"
} | cs8_fixed_train_11943 | train | T1 |
v1 | Schema:
requests (alias: ordr)(amount, code, type, date)
transactions(level, id, salary, code)
Task: Retrieve salary from requests whose type is found in transactions rows where code matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_11944 | train | T2 |
v1 | Schema:
transactions (alias: txn)(level, amount, salary, type)
products(type, salary, id, level)
Task: Retrieve code from transactions whose status is found in products rows where id matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE status IN (
SELECT status 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": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_11945 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, salary, code, date)
schedules(id, date, value, level)
Task: Retrieve code from shipments that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_11946 | train | T2 |
v2 | Schema:
managers (alias: mgr)(status, amount, type, name)
categories(salary, type, id, value)
Task: Retrieve value from managers that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_11947 | train | T1 |
v2 | Schema:
staff (alias: empl)(level, status, date, value)
departments(id, salary, level, amount)
Task: Find name from staff where a matching record exists in departments with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_11948 | train | T2 |
v2 | Schema:
regions (alias: rgn)(salary, id, value, code)
employees(date, id, name, salary)
Task: Retrieve id from regions that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_11949 | train | T2 |
v1 | Schema:
invoices (alias: inv)(type, id, status, code)
categories(status, level, amount, id)
Task: Select amount from invoices where code exists in categories for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1"
} | cs8_fixed_train_11950 | train | T1 |
v1 | Schema:
departments (alias: dept)(level, amount, date, value)
warehouses(date, salary, type, status)
Task: Select id from departments where status exists in warehouses for the same status.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM warehouses AS whs
WHERE whs.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "warehouses",
"outer_alias": "dept",
"inner_alias": "whs",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_11951 | train | T1 |
v2 | Schema:
categories (alias: catg)(amount, salary, id, name)
products(salary, status, code, amount)
Task: Find name from categories where a matching record exists in products with the same level.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_11952 | train | T2 |
v2 | Schema:
sales (alias: sale)(status, name, type, date)
staff(type, name, value, level)
Task: Retrieve name from sales that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1"
} | cs8_fixed_train_11953 | train | T1 |
v3 | Schema:
sales (alias: sale)(value, amount, salary, status)
warehouses(salary, type, value, level)
Task: Retrieve salary from sales with amount above the MIN(value) of warehouses rows sharing the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT MIN(value) FROM warehouses AS whs
WHERE whs.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "warehouses",
"outer_alias": "sale",
"inner_alias": "whs",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_11954 | train | T1 |
v2 | Schema:
transactions (alias: txn)(value, date, id, code)
customers(code, name, level, amount)
Task: Retrieve amount from transactions that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_11955 | train | T1 |
v2 | Schema:
shipments (alias: shp)(value, type, code, amount)
employees(amount, name, type, salary)
Task: Retrieve id from shipments that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_11956 | train | T2 |
v2 | Schema:
transactions (alias: txn)(name, code, value, id)
products(id, salary, name, amount)
Task: Find salary from transactions where a matching record exists in products with the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_11957 | train | T1 |
v3 | Schema:
transactions (alias: txn)(name, date, status, salary)
sales(id, code, status, level)
Task: Retrieve code from transactions with value above the SUM(salary) of sales rows sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_11958 | train | T1 |
v1 | Schema:
sales (alias: sale)(type, amount, code, name)
managers(value, type, id, salary)
Task: Select amount from sales where type exists in managers for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1"
} | cs8_fixed_train_11959 | train | T1 |
v3 | Schema:
products (alias: prod)(id, name, status, amount)
regions(name, id, date, value)
Task: Retrieve value from products with amount above the AVG(salary) of regions rows sharing the same type.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1"
} | cs8_fixed_train_11960 | train | T1 |
v1 | Schema:
orders (alias: ord)(amount, date, name, type)
staff(level, id, name, value)
Task: Select salary from orders where id exists in staff for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_11961 | train | T1 |
v2 | Schema:
departments (alias: dept)(type, amount, id, name)
staff(date, code, id, name)
Task: Retrieve amount from departments that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_11962 | train | T1 |
v1 | Schema:
sales (alias: sale)(salary, amount, name, code)
budgets(salary, type, code, date)
Task: Find code from sales where id appears in budgets entries with matching level.
SQL: | SELECT code FROM sales AS sale
WHERE id IN (
SELECT id FROM budgets AS budg
WHERE budg.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "budgets",
"outer_alias": "sale",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1"
} | cs8_fixed_train_11963 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(amount, id, type, salary)
shipments(type, date, id, value)
Task: Retrieve amount from warehouses that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "shipments",
"outer_alias": "whs",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_11964 | train | T2 |
v1 | Schema:
services (alias: srvc)(status, code, type, amount)
managers(name, id, value, status)
Task: Select value from services where level exists in managers for the same id.
SQL: | SELECT value FROM services AS srvc
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "managers",
"outer_alias": "srvc",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_11965 | train | T2 |
v2 | Schema:
orders (alias: ord)(type, salary, date, level)
categories(status, code, value, level)
Task: Find name from orders where a matching record exists in categories with the same type.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_11966 | train | T1 |
v1 | Schema:
employees (alias: emp)(code, type, id, status)
sales(status, level, code, id)
Task: Select salary from employees where status exists in sales for the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_11967 | train | T1 |
v2 | Schema:
departments (alias: dept)(value, date, id, code)
staff(level, id, amount, name)
Task: Find id from departments where a matching record exists in staff with the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_11968 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, value, code, salary)
orders(id, name, value, salary)
Task: Retrieve code from categories whose id is found in orders rows where type matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_11969 | train | T2 |
v1 | Schema:
regions (alias: rgn)(code, id, date, value)
schedules(code, name, status, date)
Task: Find code from regions where code appears in schedules entries with matching status.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_11970 | train | T2 |
v1 | Schema:
customers (alias: cust)(name, level, salary, date)
budgets(status, salary, code, name)
Task: Select code from customers where status exists in budgets for the same level.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM budgets AS budg
WHERE budg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "budgets",
"outer_alias": "cust",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_11971 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(value, level, id, amount)
items(amount, level, date, value)
Task: Retrieve salary from warehouses that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT salary FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "items",
"outer_alias": "whs",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_11972 | train | T2 |
v3 | Schema:
staff (alias: empl)(date, id, value, code)
products(value, level, amount, type)
Task: Retrieve id from staff with salary above the SUM(amount) of products rows sharing the same status.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_11973 | train | T2 |
v1 | Schema:
services (alias: srvc)(level, value, type, status)
warehouses(amount, name, salary, date)
Task: Select value from services where id exists in warehouses for the same level.
SQL: | SELECT value FROM services AS srvc
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.level = srvc.level
); | {
"outer_table": "services",
"inner_table": "warehouses",
"outer_alias": "srvc",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "srvc.level",
"token_group": "T2"
} | cs8_fixed_train_11974 | train | T2 |
v3 | Schema:
budgets (alias: budg)(date, code, id, salary)
sales(value, amount, type, code)
Task: Retrieve code from budgets with amount above the SUM(amount) of sales rows sharing the same type.
SQL: | SELECT code FROM budgets AS budg
WHERE amount > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.type = budg.type
); | {
"outer_table": "budgets",
"inner_table": "sales",
"outer_alias": "budg",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "budg.type",
"token_group": "T2"
} | cs8_fixed_train_11975 | train | T2 |
v2 | Schema:
services (alias: srvc)(date, name, id, type)
employees(id, status, type, level)
Task: Retrieve amount from services that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT amount FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = srvc.type
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "srvc.type",
"token_group": "T2"
} | cs8_fixed_train_11976 | train | T2 |
v2 | Schema:
products (alias: prod)(value, status, level, id)
customers(type, code, salary, value)
Task: Find name from products where a matching record exists in customers with the same id.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = prod.id
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_11977 | train | T1 |
v1 | Schema:
requests (alias: ordr)(type, salary, code, value)
categories(name, salary, id, date)
Task: Select code from requests where id exists in categories for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2"
} | cs8_fixed_train_11978 | train | T2 |
v3 | Schema:
employees (alias: emp)(amount, value, id, code)
sales(code, salary, status, level)
Task: Find name from employees where value exceeds the average salary from sales for the same id.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_11979 | train | T1 |
v2 | Schema:
categories (alias: catg)(id, status, value, amount)
transactions(id, type, level, date)
Task: Find code from categories where a matching record exists in transactions with the same type.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_11980 | train | T2 |
v3 | Schema:
items (alias: lne)(code, date, type, level)
departments(date, id, salary, value)
Task: Retrieve salary from items with salary above the MAX(salary) of departments rows sharing the same id.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.id = lne.id
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_11981 | train | T2 |
v2 | Schema:
customers (alias: cust)(name, code, id, level)
products(value, salary, status, name)
Task: Find name from customers where a matching record exists in products with the same level.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_11982 | train | T1 |
v3 | Schema:
products (alias: prod)(name, type, level, code)
managers(level, status, amount, name)
Task: Retrieve salary from products with value above the SUM(amount) of managers rows sharing the same level.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_11983 | train | T1 |
v2 | Schema:
transactions (alias: txn)(id, type, status, level)
warehouses(id, name, type, code)
Task: Retrieve salary from transactions that have at least one corresponding entry in warehouses sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1"
} | cs8_fixed_train_11984 | train | T1 |
v3 | Schema:
employees (alias: emp)(amount, status, level, salary)
accounts(id, type, value, level)
Task: Retrieve salary from employees with amount above the MIN(amount) of accounts rows sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_11985 | train | T1 |
v3 | Schema:
employees (alias: emp)(amount, value, level, salary)
departments(amount, name, level, date)
Task: Retrieve salary from employees with value above the AVG(amount) of departments rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT AVG(amount) FROM departments AS dept
WHERE dept.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1"
} | cs8_fixed_train_11986 | train | T1 |
v2 | Schema:
warehouses (alias: whs)(name, status, value, type)
budgets(value, status, type, salary)
Task: Find code from warehouses where a matching record exists in budgets with the same code.
SQL: | SELECT code FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM budgets AS budg
WHERE budg.code = whs.code
); | {
"outer_table": "warehouses",
"inner_table": "budgets",
"outer_alias": "whs",
"inner_alias": "budg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "whs.code",
"token_group": "T2"
} | cs8_fixed_train_11987 | train | T2 |
v1 | Schema:
categories (alias: catg)(name, code, status, type)
sales(name, level, type, value)
Task: Find amount from categories where level appears in sales entries with matching code.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_11988 | train | T2 |
v2 | Schema:
transactions (alias: txn)(status, level, type, salary)
sales(value, amount, salary, name)
Task: Retrieve amount from transactions that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1"
} | cs8_fixed_train_11989 | train | T1 |
v3 | Schema:
staff (alias: empl)(status, level, code, name)
schedules(value, salary, amount, status)
Task: Retrieve value from staff with salary above the AVG(value) of schedules rows sharing the same level.
SQL: | SELECT value FROM staff AS empl
WHERE salary > (
SELECT AVG(value) FROM schedules AS schd
WHERE schd.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_11990 | train | T2 |
v2 | Schema:
schedules (alias: schd)(salary, id, amount, code)
employees(value, amount, status, salary)
Task: Retrieve code from schedules that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_11991 | train | T2 |
v3 | Schema:
transactions (alias: txn)(id, status, type, amount)
requests(id, status, type, salary)
Task: Find name from transactions where salary exceeds the average value from requests for the same id.
SQL: | SELECT name FROM transactions AS txn
WHERE salary > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_11992 | train | T1 |
v3 | Schema:
managers (alias: mgr)(type, name, status, salary)
warehouses(level, id, salary, status)
Task: Find amount from managers where amount exceeds the average value from warehouses for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT AVG(value) FROM warehouses AS whs
WHERE whs.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1"
} | cs8_fixed_train_11993 | train | T1 |
v1 | Schema:
customers (alias: cust)(amount, status, id, name)
products(level, code, id, salary)
Task: Find value from customers where type appears in products entries with matching code.
SQL: | SELECT value FROM customers AS cust
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1"
} | cs8_fixed_train_11994 | train | T1 |
v3 | Schema:
customers (alias: cust)(salary, name, id, code)
products(id, type, value, code)
Task: Find id from customers where salary exceeds the average salary from products for the same type.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_11995 | train | T1 |
v2 | Schema:
departments (alias: dept)(id, value, type, date)
shipments(code, date, status, amount)
Task: Find salary from departments where a matching record exists in shipments with the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_11996 | train | T1 |
v3 | Schema:
employees (alias: emp)(level, code, status, amount)
shipments(amount, type, value, salary)
Task: Retrieve id from employees with value above the MAX(salary) of shipments rows sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT MAX(salary) FROM shipments AS shp
WHERE shp.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_11997 | train | T1 |
v1 | Schema:
managers (alias: mgr)(salary, level, amount, status)
services(status, amount, name, level)
Task: Retrieve code from managers whose code is found in services rows where level matches the outer record.
SQL: | SELECT code FROM managers AS mgr
WHERE code IN (
SELECT code FROM services AS srvc
WHERE srvc.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "services",
"outer_alias": "mgr",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_11998 | train | T1 |
v2 | Schema:
budgets (alias: budg)(amount, date, salary, level)
warehouses(name, status, type, code)
Task: Retrieve id from budgets that have at least one corresponding entry in warehouses sharing the same id.
SQL: | SELECT id FROM budgets AS budg
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "warehouses",
"outer_alias": "budg",
"inner_alias": "whs",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_11999 | train | T2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.