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:
staff (alias: empl)(level, status, value, salary)
services(type, level, value, amount)
Task: Find amount from staff where id appears in services entries with matching type.
SQL: | SELECT amount FROM staff AS empl
WHERE id IN (
SELECT id FROM services AS srvc
WHERE srvc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "services",
"outer_alias": "empl",
"inner_alias": "srvc",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06000 | train | T2 |
v3 | Schema:
managers (alias: mgr)(name, id, level, status)
orders(amount, value, type, level)
Task: Retrieve id from managers with salary above the AVG(amount) of orders rows sharing the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06001 | train | T1 |
v1 | Schema:
categories (alias: catg)(date, status, value, level)
invoices(id, salary, value, date)
Task: Find amount from categories where level appears in invoices entries with matching level.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM invoices AS inv
WHERE inv.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2"
} | cs8_fixed_train_06002 | train | T2 |
v2 | Schema:
sales (alias: sale)(status, date, value, salary)
regions(id, amount, status, level)
Task: Retrieve name from sales that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1"
} | cs8_fixed_train_06003 | train | T1 |
v2 | Schema:
schedules (alias: schd)(date, value, name, type)
shipments(type, value, level, code)
Task: Find amount from schedules where a matching record exists in shipments with the same code.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2"
} | cs8_fixed_train_06004 | train | T2 |
v1 | Schema:
staff (alias: empl)(code, status, name, level)
customers(value, code, status, id)
Task: Select value from staff where code exists in customers for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2"
} | cs8_fixed_train_06005 | train | T2 |
v1 | Schema:
managers (alias: mgr)(id, amount, date, code)
transactions(salary, date, name, code)
Task: Select code from managers where level exists in transactions for the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06006 | train | T1 |
v2 | Schema:
accounts (alias: acct)(amount, code, date, name)
shipments(code, value, level, salary)
Task: Find value from accounts where a matching record exists in shipments with the same code.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_06007 | train | T1 |
v3 | Schema:
products (alias: prod)(amount, salary, code, value)
budgets(code, date, level, amount)
Task: Retrieve code from products with value above the MIN(salary) of budgets rows sharing the same level.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT MIN(salary) FROM budgets AS budg
WHERE budg.level = prod.level
); | {
"outer_table": "products",
"inner_table": "budgets",
"outer_alias": "prod",
"inner_alias": "budg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06008 | train | T1 |
v2 | Schema:
shipments (alias: shp)(salary, date, id, value)
items(id, date, type, value)
Task: Retrieve name from shipments that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2"
} | cs8_fixed_train_06009 | train | T2 |
v3 | Schema:
regions (alias: rgn)(date, status, salary, id)
items(level, id, type, amount)
Task: Find id from regions where salary exceeds the average value from items for the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2"
} | cs8_fixed_train_06010 | train | T2 |
v1 | Schema:
managers (alias: mgr)(code, amount, level, salary)
items(salary, date, name, type)
Task: Retrieve name from managers whose level is found in items rows where level matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06011 | train | T1 |
v1 | Schema:
products (alias: prod)(salary, name, type, value)
staff(type, status, name, amount)
Task: Select value from products where status exists in staff for the same id.
SQL: | SELECT value FROM products AS prod
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.id = prod.id
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_06012 | train | T1 |
v1 | Schema:
products (alias: prod)(name, amount, value, status)
schedules(date, value, amount, salary)
Task: Select value from products where type exists in schedules for the same code.
SQL: | SELECT value FROM products AS prod
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = prod.code
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_06013 | train | T1 |
v2 | Schema:
staff (alias: empl)(type, value, id, code)
departments(type, date, level, status)
Task: Retrieve salary from staff that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2"
} | cs8_fixed_train_06014 | train | T2 |
v1 | Schema:
staff (alias: empl)(level, name, salary, id)
requests(status, level, date, name)
Task: Find salary from staff where level appears in requests entries with matching type.
SQL: | SELECT salary FROM staff AS empl
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06015 | train | T2 |
v3 | Schema:
categories (alias: catg)(date, status, code, type)
items(id, type, level, salary)
Task: Retrieve id from categories with value above the COUNT(value) of items rows sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_06016 | train | T2 |
v2 | Schema:
managers (alias: mgr)(salary, type, name, code)
schedules(name, date, status, salary)
Task: Find id from managers where a matching record exists in schedules with the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06017 | train | T1 |
v2 | Schema:
products (alias: prod)(id, name, level, salary)
sales(amount, salary, type, code)
Task: Retrieve id from products that have at least one corresponding entry in sales sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.level = prod.level
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06018 | train | T1 |
v2 | Schema:
services (alias: srvc)(type, date, id, salary)
warehouses(id, status, level, name)
Task: Retrieve name from services that have at least one corresponding entry in warehouses sharing the same id.
SQL: | SELECT name 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": "name",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06019 | train | T2 |
v2 | Schema:
services (alias: srvc)(level, salary, code, amount)
categories(salary, status, id, date)
Task: Find code from services where a matching record exists in categories with the same code.
SQL: | SELECT code FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "categories",
"outer_alias": "srvc",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_06020 | train | T2 |
v2 | Schema:
products (alias: prod)(status, code, level, date)
managers(level, value, date, salary)
Task: Retrieve code from products that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1"
} | cs8_fixed_train_06021 | train | T1 |
v2 | Schema:
transactions (alias: txn)(salary, level, id, amount)
services(code, amount, id, status)
Task: Retrieve salary from transactions that have at least one corresponding entry in services sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "services",
"outer_alias": "txn",
"inner_alias": "srvc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1"
} | cs8_fixed_train_06022 | train | T1 |
v3 | Schema:
categories (alias: catg)(status, salary, id, level)
products(date, salary, value, name)
Task: Find name from categories where value exceeds the average amount from products for the same code.
SQL: | SELECT name FROM categories AS catg
WHERE value > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06023 | train | T2 |
v3 | Schema:
regions (alias: rgn)(status, value, code, type)
invoices(name, id, status, type)
Task: Find salary from regions where amount exceeds the average value from invoices for the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2"
} | cs8_fixed_train_06024 | train | T2 |
v1 | Schema:
employees (alias: emp)(value, code, level, name)
customers(name, value, salary, level)
Task: Find name from employees where type appears in customers entries with matching status.
SQL: | SELECT name FROM employees AS emp
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1"
} | cs8_fixed_train_06025 | train | T1 |
v1 | Schema:
services (alias: srvc)(name, code, date, value)
employees(id, name, code, date)
Task: Select code from services where id exists in employees for the same status.
SQL: | SELECT code FROM services AS srvc
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = srvc.status
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "srvc.status",
"token_group": "T2"
} | cs8_fixed_train_06026 | train | T2 |
v1 | Schema:
categories (alias: catg)(date, value, id, type)
shipments(code, id, date, amount)
Task: Retrieve id from categories whose id is found in shipments rows where type matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_06027 | train | T2 |
v1 | Schema:
categories (alias: catg)(value, amount, salary, id)
departments(value, name, level, id)
Task: Find id from categories where status appears in departments entries with matching code.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06028 | train | T2 |
v3 | Schema:
products (alias: prod)(id, status, date, name)
staff(id, date, type, salary)
Task: Retrieve amount from products with value above the COUNT(amount) of staff rows sharing the same code.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT COUNT(amount) FROM staff AS empl
WHERE empl.code = prod.code
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1"
} | cs8_fixed_train_06029 | train | T1 |
v1 | Schema:
employees (alias: emp)(name, type, status, code)
budgets(name, code, value, id)
Task: Find id from employees where level appears in budgets entries with matching level.
SQL: | SELECT id FROM employees AS emp
WHERE level IN (
SELECT level FROM budgets AS budg
WHERE budg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "budgets",
"outer_alias": "emp",
"inner_alias": "budg",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06030 | train | T1 |
v1 | Schema:
orders (alias: ord)(value, id, amount, type)
invoices(value, level, type, date)
Task: Retrieve amount from orders whose status is found in invoices rows where level matches the outer record.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1"
} | cs8_fixed_train_06031 | train | T1 |
v2 | Schema:
schedules (alias: schd)(code, status, level, name)
departments(salary, level, date, status)
Task: Retrieve amount from schedules that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06032 | train | T2 |
v3 | Schema:
customers (alias: cust)(name, status, id, amount)
orders(id, code, level, salary)
Task: Find value from customers where salary exceeds the average value from orders for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT MAX(value) FROM orders AS ord
WHERE ord.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1"
} | cs8_fixed_train_06033 | train | T1 |
v3 | Schema:
shipments (alias: shp)(type, level, code, name)
sales(date, name, value, level)
Task: Find salary from shipments where value exceeds the average amount from sales for the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_06034 | train | T2 |
v2 | Schema:
shipments (alias: shp)(status, type, salary, amount)
categories(value, status, type, code)
Task: Retrieve amount from shipments that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2"
} | cs8_fixed_train_06035 | train | T2 |
v1 | Schema:
departments (alias: dept)(amount, type, name, salary)
regions(code, salary, type, date)
Task: Retrieve value from departments whose id is found in regions rows where code matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1"
} | cs8_fixed_train_06036 | train | T1 |
v2 | Schema:
customers (alias: cust)(name, amount, status, code)
regions(type, name, value, level)
Task: Retrieve value from customers that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "regions",
"outer_alias": "cust",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1"
} | cs8_fixed_train_06037 | train | T1 |
v3 | Schema:
managers (alias: mgr)(status, salary, date, level)
sales(value, code, salary, id)
Task: Find salary from managers where value exceeds the average value from sales for the same code.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT AVG(value) FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06038 | train | T1 |
v3 | Schema:
orders (alias: ord)(level, name, value, amount)
accounts(name, code, status, amount)
Task: Retrieve salary from orders with salary above the COUNT(value) of accounts rows sharing the same id.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1"
} | cs8_fixed_train_06039 | train | T1 |
v3 | Schema:
invoices (alias: inv)(value, id, level, date)
employees(type, id, amount, status)
Task: Retrieve value from invoices with value above the SUM(amount) of employees rows sharing the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE value > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_06040 | train | T1 |
v1 | Schema:
departments (alias: dept)(value, type, code, date)
categories(name, amount, status, salary)
Task: Retrieve code from departments whose code is found in categories rows where status matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1"
} | cs8_fixed_train_06041 | train | T1 |
v1 | Schema:
employees (alias: emp)(id, value, type, name)
staff(type, name, amount, code)
Task: Retrieve salary from employees whose type is found in staff rows where type matches the outer record.
SQL: | SELECT salary FROM employees AS emp
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1"
} | cs8_fixed_train_06042 | train | T1 |
v3 | Schema:
budgets (alias: budg)(name, level, type, date)
shipments(date, type, amount, salary)
Task: Retrieve code from budgets with value above the COUNT(salary) of shipments rows sharing the same code.
SQL: | SELECT code FROM budgets AS budg
WHERE value > (
SELECT COUNT(salary) FROM shipments AS shp
WHERE shp.code = budg.code
); | {
"outer_table": "budgets",
"inner_table": "shipments",
"outer_alias": "budg",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "budg.code",
"token_group": "T2"
} | cs8_fixed_train_06043 | train | T2 |
v1 | Schema:
orders (alias: ord)(value, date, name, type)
regions(salary, name, date, code)
Task: Select code from orders where level exists in regions for the same status.
SQL: | SELECT code FROM orders AS ord
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1"
} | cs8_fixed_train_06044 | train | T1 |
v2 | Schema:
services (alias: srvc)(status, amount, type, value)
sales(salary, status, name, type)
Task: Retrieve value from services that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT value FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = srvc.id
); | {
"outer_table": "services",
"inner_table": "sales",
"outer_alias": "srvc",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "srvc.id",
"token_group": "T2"
} | cs8_fixed_train_06045 | train | T2 |
v1 | Schema:
shipments (alias: shp)(level, salary, value, code)
accounts(date, code, value, name)
Task: Select value from shipments where code exists in accounts for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_06046 | train | T2 |
v1 | Schema:
schedules (alias: schd)(date, name, id, salary)
managers(name, status, salary, id)
Task: Retrieve name from schedules whose code is found in managers rows where status matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06047 | train | T2 |
v2 | Schema:
warehouses (alias: whs)(name, salary, id, amount)
transactions(id, name, date, type)
Task: Find amount from warehouses where a matching record exists in transactions with the same status.
SQL: | SELECT amount FROM warehouses AS whs
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = whs.status
); | {
"outer_table": "warehouses",
"inner_table": "transactions",
"outer_alias": "whs",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "whs.status",
"token_group": "T2"
} | cs8_fixed_train_06048 | train | T2 |
v1 | Schema:
schedules (alias: schd)(date, value, name, salary)
managers(value, id, date, level)
Task: Retrieve code from schedules whose id is found in managers rows where type matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2"
} | cs8_fixed_train_06049 | train | T2 |
v3 | Schema:
items (alias: lne)(type, id, salary, date)
shipments(level, name, code, amount)
Task: Retrieve salary from items with value above the MAX(value) of shipments rows sharing the same id.
SQL: | SELECT salary FROM items AS lne
WHERE value > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06050 | train | T2 |
v1 | Schema:
invoices (alias: inv)(status, name, code, date)
managers(code, salary, id, amount)
Task: Select id from invoices where code exists in managers for the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1"
} | cs8_fixed_train_06051 | train | T1 |
v1 | Schema:
managers (alias: mgr)(value, id, type, amount)
orders(id, name, code, status)
Task: Find name from managers where id appears in orders entries with matching code.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1"
} | cs8_fixed_train_06052 | train | T1 |
v2 | Schema:
departments (alias: dept)(code, salary, level, name)
shipments(amount, name, value, date)
Task: Find code from departments where a matching record exists in shipments with the same type.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1"
} | cs8_fixed_train_06053 | train | T1 |
v3 | Schema:
schedules (alias: schd)(value, type, status, date)
accounts(value, date, type, level)
Task: Retrieve id from schedules with salary above the AVG(value) of accounts rows sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2"
} | cs8_fixed_train_06054 | train | T2 |
v2 | Schema:
shipments (alias: shp)(id, amount, code, date)
requests(salary, amount, id, level)
Task: Find name from shipments where a matching record exists in requests with the same type.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2"
} | cs8_fixed_train_06055 | train | T2 |
v2 | Schema:
services (alias: srvc)(id, value, name, level)
employees(amount, value, type, level)
Task: Retrieve salary from services that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT salary FROM services AS srvc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = srvc.code
); | {
"outer_table": "services",
"inner_table": "employees",
"outer_alias": "srvc",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "srvc.code",
"token_group": "T2"
} | cs8_fixed_train_06056 | train | T2 |
v3 | Schema:
regions (alias: rgn)(date, salary, name, code)
employees(date, code, amount, salary)
Task: Find id from regions where value exceeds the average salary from employees for the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT MIN(salary) FROM employees AS emp
WHERE emp.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "employees",
"outer_alias": "rgn",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2"
} | cs8_fixed_train_06057 | train | T2 |
v3 | Schema:
accounts (alias: acct)(level, date, value, code)
schedules(value, status, amount, type)
Task: Find code from accounts where amount exceeds the average amount from schedules for the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT MIN(amount) FROM schedules AS schd
WHERE schd.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_06058 | train | T1 |
v2 | Schema:
staff (alias: empl)(name, date, salary, id)
customers(id, status, code, amount)
Task: Retrieve name from staff that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_06059 | train | T2 |
v2 | Schema:
categories (alias: catg)(amount, value, date, salary)
invoices(id, value, type, date)
Task: Retrieve code from categories that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2"
} | cs8_fixed_train_06060 | train | T2 |
v3 | Schema:
products (alias: prod)(status, salary, amount, value)
departments(date, salary, id, level)
Task: Retrieve value from products with value above the MAX(amount) of departments rows sharing the same level.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.level = prod.level
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1"
} | cs8_fixed_train_06061 | train | T1 |
v3 | Schema:
departments (alias: dept)(amount, value, type, name)
products(amount, id, code, value)
Task: Retrieve value from departments with value above the SUM(amount) of products rows sharing the same level.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT SUM(amount) FROM products AS prod
WHERE prod.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1"
} | cs8_fixed_train_06062 | train | T1 |
v3 | Schema:
accounts (alias: acct)(type, salary, status, name)
requests(id, value, salary, status)
Task: Find amount from accounts where salary exceeds the average salary from requests for the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1"
} | cs8_fixed_train_06063 | train | T1 |
v2 | Schema:
staff (alias: empl)(name, date, value, salary)
sales(amount, id, status, code)
Task: Find amount from staff where a matching record exists in sales with the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2"
} | cs8_fixed_train_06064 | train | T2 |
v1 | Schema:
customers (alias: cust)(name, level, salary, amount)
schedules(date, level, type, amount)
Task: Select salary from customers where id exists in schedules for the same status.
SQL: | SELECT salary FROM customers AS cust
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06065 | train | T1 |
v1 | Schema:
accounts (alias: acct)(type, name, salary, level)
sales(code, status, amount, date)
Task: Retrieve id from accounts whose level is found in sales rows where status matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1"
} | cs8_fixed_train_06066 | train | T1 |
v1 | Schema:
requests (alias: ordr)(amount, date, code, id)
schedules(id, name, code, level)
Task: Select name from requests where type exists in schedules for the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2"
} | cs8_fixed_train_06067 | train | T2 |
v2 | Schema:
transactions (alias: txn)(salary, status, value, code)
categories(date, level, status, amount)
Task: Retrieve salary from transactions that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1"
} | cs8_fixed_train_06068 | train | T1 |
v1 | Schema:
schedules (alias: schd)(name, type, id, value)
departments(id, type, status, salary)
Task: Find value from schedules where type appears in departments entries with matching status.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2"
} | cs8_fixed_train_06069 | train | T2 |
v1 | Schema:
categories (alias: catg)(date, amount, code, salary)
staff(amount, code, status, level)
Task: Select amount from categories where code exists in staff for the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2"
} | cs8_fixed_train_06070 | train | T2 |
v3 | Schema:
budgets (alias: budg)(type, code, amount, value)
categories(status, amount, level, date)
Task: Find name from budgets where salary exceeds the average salary from categories for the same id.
SQL: | SELECT name FROM budgets AS budg
WHERE salary > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.id = budg.id
); | {
"outer_table": "budgets",
"inner_table": "categories",
"outer_alias": "budg",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "budg.id",
"token_group": "T2"
} | cs8_fixed_train_06071 | train | T2 |
v1 | Schema:
regions (alias: rgn)(id, level, date, salary)
departments(level, value, status, type)
Task: Select name from regions where type exists in departments for the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2"
} | cs8_fixed_train_06072 | train | T2 |
v3 | Schema:
categories (alias: catg)(type, date, value, name)
employees(name, status, type, value)
Task: Find code from categories where amount exceeds the average salary from employees for the same code.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2"
} | cs8_fixed_train_06073 | train | T2 |
v3 | Schema:
managers (alias: mgr)(level, name, salary, type)
accounts(name, type, amount, level)
Task: Find name from managers where value exceeds the average amount from accounts for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06074 | train | T1 |
v2 | Schema:
departments (alias: dept)(code, value, date, type)
customers(name, salary, level, code)
Task: Retrieve value from departments that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1"
} | cs8_fixed_train_06075 | train | T1 |
v1 | Schema:
staff (alias: empl)(salary, type, level, name)
regions(date, name, amount, level)
Task: Retrieve value from staff whose type is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2"
} | cs8_fixed_train_06076 | train | T2 |
v2 | Schema:
customers (alias: cust)(id, level, value, salary)
services(status, code, date, level)
Task: Find value from customers where a matching record exists in services with the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM services AS srvc
WHERE srvc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "services",
"outer_alias": "cust",
"inner_alias": "srvc",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1"
} | cs8_fixed_train_06077 | train | T1 |
v3 | Schema:
items (alias: lne)(id, value, code, date)
staff(id, code, salary, name)
Task: Find name from items where amount exceeds the average salary from staff for the same code.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.code = lne.code
); | {
"outer_table": "items",
"inner_table": "staff",
"outer_alias": "lne",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2"
} | cs8_fixed_train_06078 | train | T2 |
v3 | Schema:
orders (alias: ord)(amount, status, level, name)
managers(salary, value, status, name)
Task: Find code from orders where value exceeds the average value from managers for the same type.
SQL: | SELECT code FROM orders AS ord
WHERE value > (
SELECT MAX(value) FROM managers AS mgr
WHERE mgr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "ord",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1"
} | cs8_fixed_train_06079 | train | T1 |
v3 | Schema:
items (alias: lne)(name, status, value, code)
services(status, name, level, value)
Task: Retrieve code from items with amount above the SUM(amount) of services rows sharing the same id.
SQL: | SELECT code FROM items AS lne
WHERE amount > (
SELECT SUM(amount) FROM services AS srvc
WHERE srvc.id = lne.id
); | {
"outer_table": "items",
"inner_table": "services",
"outer_alias": "lne",
"inner_alias": "srvc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06080 | train | T2 |
v2 | Schema:
employees (alias: emp)(name, value, level, id)
categories(code, type, salary, value)
Task: Retrieve name from employees that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1"
} | cs8_fixed_train_06081 | train | T1 |
v2 | Schema:
employees (alias: emp)(status, salary, value, amount)
products(value, status, level, date)
Task: Retrieve id from employees that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "products",
"outer_alias": "emp",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1"
} | cs8_fixed_train_06082 | train | T1 |
v1 | Schema:
warehouses (alias: whs)(status, amount, type, name)
customers(value, amount, code, level)
Task: Find code from warehouses where code appears in customers entries with matching type.
SQL: | SELECT code FROM warehouses AS whs
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.type = whs.type
); | {
"outer_table": "warehouses",
"inner_table": "customers",
"outer_alias": "whs",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "whs.type",
"token_group": "T2"
} | cs8_fixed_train_06083 | train | T2 |
v3 | Schema:
items (alias: lne)(amount, status, type, name)
employees(type, amount, name, id)
Task: Retrieve name from items with salary above the COUNT(amount) of employees rows sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT COUNT(amount) FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06084 | train | T2 |
v3 | Schema:
invoices (alias: inv)(name, id, type, date)
budgets(name, amount, code, id)
Task: Find amount from invoices where value exceeds the average salary from budgets for the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM budgets AS budg
WHERE budg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "budgets",
"outer_alias": "inv",
"inner_alias": "budg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1"
} | cs8_fixed_train_06085 | train | T1 |
v3 | Schema:
budgets (alias: budg)(amount, date, level, id)
requests(code, level, status, name)
Task: Find value from budgets where value exceeds the average amount from requests for the same level.
SQL: | SELECT value FROM budgets AS budg
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "requests",
"outer_alias": "budg",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_06086 | train | T2 |
v2 | Schema:
accounts (alias: acct)(type, name, id, level)
sales(level, id, date, code)
Task: Find name from accounts where a matching record exists in sales with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1"
} | cs8_fixed_train_06087 | train | T1 |
v1 | Schema:
budgets (alias: budg)(date, value, status, level)
transactions(id, amount, value, code)
Task: Retrieve name from budgets whose level is found in transactions rows where level matches the outer record.
SQL: | SELECT name FROM budgets AS budg
WHERE level IN (
SELECT level FROM transactions AS txn
WHERE txn.level = budg.level
); | {
"outer_table": "budgets",
"inner_table": "transactions",
"outer_alias": "budg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "budg.level",
"token_group": "T2"
} | cs8_fixed_train_06088 | train | T2 |
v3 | Schema:
managers (alias: mgr)(code, status, id, date)
orders(date, salary, amount, value)
Task: Find id from managers where value exceeds the average amount from orders for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06089 | train | T1 |
v1 | Schema:
shipments (alias: shp)(id, date, amount, type)
invoices(value, amount, salary, id)
Task: Retrieve amount from shipments whose id is found in invoices rows where code matches the outer record.
SQL: | SELECT amount FROM shipments AS shp
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2"
} | cs8_fixed_train_06090 | train | T2 |
v2 | Schema:
managers (alias: mgr)(name, salary, level, value)
items(name, date, value, status)
Task: Retrieve code from managers that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06091 | train | T1 |
v1 | Schema:
managers (alias: mgr)(level, id, type, status)
departments(type, status, level, code)
Task: Retrieve salary from managers whose id is found in departments rows where level matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1"
} | cs8_fixed_train_06092 | train | T1 |
v1 | Schema:
orders (alias: ord)(name, salary, value, type)
transactions(id, type, level, date)
Task: Find salary from orders where code appears in transactions entries with matching code.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1"
} | cs8_fixed_train_06093 | train | T1 |
v1 | Schema:
products (alias: prod)(level, amount, value, name)
warehouses(salary, amount, id, date)
Task: Retrieve value from products whose id is found in warehouses rows where status matches the outer record.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM warehouses AS whs
WHERE whs.status = prod.status
); | {
"outer_table": "products",
"inner_table": "warehouses",
"outer_alias": "prod",
"inner_alias": "whs",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1"
} | cs8_fixed_train_06094 | train | T1 |
v2 | Schema:
items (alias: lne)(id, name, type, code)
accounts(date, name, level, status)
Task: Find value from items where a matching record exists in accounts with the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2"
} | cs8_fixed_train_06095 | train | T2 |
v1 | Schema:
invoices (alias: inv)(date, amount, type, salary)
categories(status, type, salary, id)
Task: Retrieve code from invoices whose id is found in categories rows where type matches the outer record.
SQL: | SELECT code FROM invoices AS inv
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1"
} | cs8_fixed_train_06096 | train | T1 |
v1 | Schema:
transactions (alias: txn)(amount, type, level, value)
warehouses(date, code, level, amount)
Task: Retrieve amount from transactions whose type is found in warehouses rows where status matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE type IN (
SELECT type FROM warehouses AS whs
WHERE whs.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "warehouses",
"outer_alias": "txn",
"inner_alias": "whs",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1"
} | cs8_fixed_train_06097 | train | T1 |
v3 | Schema:
items (alias: lne)(level, salary, type, amount)
requests(value, code, amount, id)
Task: Retrieve amount from items with salary above the MAX(amount) of requests rows sharing the same id.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2"
} | cs8_fixed_train_06098 | train | T2 |
v2 | Schema:
managers (alias: mgr)(name, id, level, status)
warehouses(name, level, id, code)
Task: Find amount from managers where a matching record exists in warehouses with the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM warehouses AS whs
WHERE whs.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "warehouses",
"outer_alias": "mgr",
"inner_alias": "whs",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1"
} | cs8_fixed_train_06099 | train | T1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.