variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
categories (alias: catg)(date, amount, id, value)
orders(value, id, type, status)
Task: Retrieve salary from categories whose status is found in orders rows where level matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02000 | train |
v1 | Schema:
departments (alias: dept)(salary, status, code, amount)
items(status, salary, name, amount)
Task: Select id from departments where level exists in items for the same type.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02001 | train |
v1 | Schema:
regions (alias: rgn)(id, status, code, type)
products(type, code, level, amount)
Task: Retrieve amount from regions whose type is found in products rows where code matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02002 | train |
v3 | Schema:
categories (alias: catg)(code, amount, level, status)
managers(status, code, salary, type)
Task: Find name from categories where amount exceeds the maximum salary from managers for the same status.
SQL: | SELECT name FROM categories AS catg
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02003 | train |
v2 | Schema:
invoices (alias: inv)(code, amount, date, type)
schedules(id, type, date, value)
Task: Retrieve salary from invoices that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02004 | train |
v1 | Schema:
orders (alias: ord)(type, level, date, status)
accounts(code, level, id, type)
Task: Find salary from orders where code appears in accounts entries with matching status.
SQL: | SELECT salary FROM orders AS ord
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02005 | train |
v1 | Schema:
employees (alias: emp)(salary, amount, date, id)
regions(status, salary, amount, date)
Task: Find salary from employees where level appears in regions entries with matching status.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02006 | train |
v2 | Schema:
schedules (alias: schd)(id, salary, status, amount)
orders(salary, date, name, code)
Task: Find code from schedules where a matching record exists in orders with the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02007 | train |
v3 | Schema:
shipments (alias: shp)(level, type, id, name)
employees(amount, status, type, value)
Task: Retrieve salary from shipments with amount above the COUNT(salary) of employees rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02008 | train |
v2 | Schema:
sales (alias: sale)(value, type, id, date)
regions(value, date, name, salary)
Task: Retrieve amount from sales that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT amount FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02009 | train |
v2 | Schema:
managers (alias: mgr)(value, code, id, salary)
sales(code, date, level, value)
Task: Retrieve code from managers that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02010 | train |
v1 | Schema:
staff (alias: empl)(status, amount, id, name)
regions(salary, type, value, date)
Task: Retrieve amount from staff whose level is found in regions rows where status matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02011 | train |
v1 | Schema:
categories (alias: catg)(salary, type, value, id)
tasks(date, value, salary, name)
Task: Select id from categories where code exists in tasks for the same code.
SQL: | SELECT id FROM categories AS catg
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02012 | train |
v2 | Schema:
departments (alias: dept)(level, status, value, code)
staff(type, salary, code, amount)
Task: Retrieve code from departments that have at least one corresponding entry in staff sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02013 | train |
v1 | Schema:
projects (alias: prj)(name, level, code, id)
departments(code, date, status, type)
Task: Find code from projects where code appears in departments entries with matching code.
SQL: | SELECT code FROM projects AS prj
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02014 | train |
v3 | Schema:
regions (alias: rgn)(name, id, code, status)
categories(code, level, value, salary)
Task: Find code from regions where value exceeds the maximum amount from categories for the same type.
SQL: | SELECT code FROM regions AS rgn
WHERE value > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02015 | train |
v1 | Schema:
regions (alias: rgn)(name, type, date, id)
invoices(name, date, type, id)
Task: Select amount from regions where status exists in invoices for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02016 | train |
v2 | Schema:
accounts (alias: acct)(level, amount, date, salary)
customers(value, code, amount, level)
Task: Find id from accounts where a matching record exists in customers with the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02017 | train |
v2 | Schema:
managers (alias: mgr)(id, status, type, amount)
projects(date, code, id, value)
Task: Retrieve code from managers that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02018 | train |
v3 | Schema:
requests (alias: ordr)(code, amount, salary, value)
customers(status, date, salary, level)
Task: Retrieve value from requests with value above the SUM(amount) of customers rows sharing the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT SUM(amount) FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02019 | train |
v2 | Schema:
tasks (alias: tsk)(status, amount, level, id)
items(value, status, code, level)
Task: Retrieve value from tasks that have at least one corresponding entry in items sharing the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02020 | train |
v3 | Schema:
accounts (alias: acct)(level, name, id, code)
managers(amount, level, code, type)
Task: Retrieve value from accounts with value above the COUNT(salary) of managers rows sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02021 | train |
v1 | Schema:
branches (alias: brc)(date, level, code, id)
accounts(date, name, id, value)
Task: Select name from branches where status exists in accounts for the same status.
SQL: | SELECT name FROM branches AS brc
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02022 | train |
v3 | Schema:
sales (alias: sale)(value, amount, code, status)
branches(type, amount, salary, name)
Task: Find salary from sales where value exceeds the maximum value from branches for the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT MAX(value) FROM branches AS brc
WHERE brc.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02023 | train |
v3 | Schema:
tasks (alias: tsk)(id, date, name, type)
sales(value, amount, name, status)
Task: Retrieve value from tasks with amount above the COUNT(salary) of sales rows sharing the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE amount > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02024 | train |
v3 | Schema:
products (alias: prod)(type, code, date, salary)
managers(value, date, type, id)
Task: Retrieve name from products with value above the SUM(amount) of managers rows sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT SUM(amount) FROM managers AS mgr
WHERE mgr.type = prod.type
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02025 | train |
v1 | Schema:
tasks (alias: tsk)(amount, status, value, date)
products(code, amount, status, level)
Task: Retrieve amount from tasks whose code is found in products rows where id matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02026 | train |
v1 | Schema:
products (alias: prod)(amount, level, date, salary)
sales(value, type, id, code)
Task: Select name from products where id exists in sales for the same code.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02027 | train |
v2 | Schema:
employees (alias: emp)(salary, amount, status, date)
orders(salary, amount, id, value)
Task: Find amount from employees where a matching record exists in orders with the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02028 | train |
v2 | Schema:
departments (alias: dept)(value, level, code, amount)
orders(name, code, level, id)
Task: Retrieve id from departments that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02029 | train |
v1 | Schema:
branches (alias: brc)(salary, status, name, amount)
managers(name, value, salary, amount)
Task: Retrieve salary from branches whose level is found in managers rows where level matches the outer record.
SQL: | SELECT salary FROM branches AS brc
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02030 | train |
v2 | Schema:
orders (alias: ord)(status, value, type, date)
categories(name, amount, id, date)
Task: Find code from orders where a matching record exists in categories with the same level.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02031 | train |
v1 | Schema:
accounts (alias: acct)(amount, status, date, value)
departments(level, value, salary, amount)
Task: Retrieve salary from accounts whose code is found in departments rows where id matches the outer record.
SQL: | SELECT salary FROM accounts AS acct
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02032 | train |
v3 | Schema:
branches (alias: brc)(value, name, salary, code)
invoices(code, type, status, salary)
Task: Retrieve name from branches with amount above the AVG(amount) of invoices rows sharing the same id.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT AVG(amount) FROM invoices AS inv
WHERE inv.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02033 | train |
v3 | Schema:
items (alias: lne)(date, salary, name, id)
employees(code, type, value, name)
Task: Retrieve salary from items with salary above the MIN(value) of employees rows sharing the same id.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02034 | train |
v3 | Schema:
branches (alias: brc)(date, status, type, level)
categories(level, id, name, status)
Task: Find code from branches where amount exceeds the count of amount from categories for the same id.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02035 | train |
v3 | Schema:
staff (alias: empl)(status, id, type, name)
sales(amount, date, code, level)
Task: Find value from staff where value exceeds the total value from sales for the same code.
SQL: | SELECT value FROM staff AS empl
WHERE value > (
SELECT SUM(value) FROM sales AS sale
WHERE sale.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02036 | train |
v1 | Schema:
tasks (alias: tsk)(value, amount, type, id)
transactions(date, type, name, code)
Task: Find salary from tasks where status appears in transactions entries with matching id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02037 | train |
v3 | Schema:
managers (alias: mgr)(salary, name, code, id)
products(id, level, type, value)
Task: Find salary from managers where value exceeds the count of amount from products for the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02038 | train |
v2 | Schema:
invoices (alias: inv)(type, status, id, value)
staff(value, type, date, amount)
Task: Retrieve name from invoices that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02039 | train |
v1 | Schema:
managers (alias: mgr)(amount, date, type, level)
orders(name, salary, code, amount)
Task: Select value from managers where code exists in orders for the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02040 | train |
v2 | Schema:
items (alias: lne)(value, level, type, status)
orders(salary, code, status, type)
Task: Retrieve salary from items that have at least one corresponding entry in orders sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02041 | train |
v1 | Schema:
managers (alias: mgr)(amount, name, type, code)
branches(amount, code, status, date)
Task: Find value from managers where type appears in branches entries with matching type.
SQL: | SELECT value FROM managers AS mgr
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02042 | train |
v2 | Schema:
managers (alias: mgr)(code, id, value, date)
departments(type, amount, status, level)
Task: Find salary from managers where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02043 | train |
v1 | Schema:
staff (alias: empl)(date, status, level, amount)
schedules(type, code, id, salary)
Task: Retrieve amount from staff whose status is found in schedules rows where code matches the outer record.
SQL: | SELECT amount FROM staff AS empl
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02044 | train |
v1 | Schema:
sales (alias: sale)(value, status, amount, code)
customers(status, id, name, date)
Task: Select amount from sales where status exists in customers for the same id.
SQL: | SELECT amount FROM sales AS sale
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02045 | train |
v1 | Schema:
branches (alias: brc)(value, date, name, level)
shipments(amount, type, value, code)
Task: Retrieve value from branches whose type is found in shipments rows where id matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02046 | train |
v2 | Schema:
tasks (alias: tsk)(amount, type, status, level)
invoices(salary, status, id, date)
Task: Retrieve amount from tasks that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02047 | train |
v3 | Schema:
categories (alias: catg)(type, code, value, level)
projects(amount, status, value, type)
Task: Find salary from categories where amount exceeds the minimum value from projects for the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT MIN(value) FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02048 | train |
v3 | Schema:
invoices (alias: inv)(date, id, code, value)
orders(date, amount, level, code)
Task: Find amount from invoices where salary exceeds the minimum value from orders for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE salary > (
SELECT MIN(value) FROM orders AS ord
WHERE ord.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02049 | train |
v2 | Schema:
schedules (alias: schd)(amount, code, name, salary)
staff(amount, type, name, level)
Task: Find amount from schedules where a matching record exists in staff with the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02050 | train |
v1 | Schema:
sales (alias: sale)(salary, id, amount, level)
requests(value, type, status, level)
Task: Select name from sales where code exists in requests for the same code.
SQL: | SELECT name FROM sales AS sale
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02051 | train |
v1 | Schema:
projects (alias: prj)(name, value, level, type)
branches(level, salary, date, status)
Task: Retrieve salary from projects whose level is found in branches rows where status matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02052 | train |
v2 | Schema:
invoices (alias: inv)(name, type, id, code)
tasks(value, date, id, level)
Task: Retrieve name from invoices that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02053 | train |
v2 | Schema:
items (alias: lne)(value, salary, level, type)
sales(id, name, amount, value)
Task: Retrieve value from items that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02054 | train |
v2 | Schema:
shipments (alias: shp)(type, status, date, salary)
regions(level, status, date, amount)
Task: Retrieve name from shipments that have at least one corresponding entry in regions sharing the same id.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02055 | train |
v1 | Schema:
schedules (alias: schd)(value, level, type, name)
employees(level, amount, salary, id)
Task: Retrieve id from schedules whose status is found in employees rows where id matches the outer record.
SQL: | SELECT id FROM schedules AS schd
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02056 | train |
v3 | Schema:
regions (alias: rgn)(date, code, type, salary)
departments(salary, value, name, id)
Task: Retrieve value from regions with amount above the MIN(salary) of departments rows sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02057 | train |
v3 | Schema:
invoices (alias: inv)(amount, level, value, type)
employees(code, id, name, status)
Task: Find value from invoices where salary exceeds the average amount from employees for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT AVG(amount) FROM employees AS emp
WHERE emp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "employees",
"outer_alias": "inv",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02058 | train |
v2 | Schema:
accounts (alias: acct)(amount, name, salary, value)
schedules(date, name, salary, id)
Task: Find amount from accounts where a matching record exists in schedules with the same code.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02059 | train |
v3 | Schema:
regions (alias: rgn)(name, salary, value, level)
managers(amount, type, level, status)
Task: Find code from regions where amount exceeds the average salary from managers for the same level.
SQL: | SELECT code FROM regions AS rgn
WHERE amount > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02060 | train |
v2 | Schema:
products (alias: prod)(salary, date, status, amount)
regions(name, value, date, type)
Task: Find salary from products where a matching record exists in regions with the same id.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02061 | train |
v2 | Schema:
schedules (alias: schd)(type, salary, date, value)
products(value, status, type, amount)
Task: Retrieve code from schedules that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02062 | train |
v2 | Schema:
transactions (alias: txn)(salary, name, status, level)
staff(level, name, date, salary)
Task: Retrieve id from transactions that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02063 | train |
v2 | Schema:
shipments (alias: shp)(code, id, date, name)
transactions(amount, code, type, name)
Task: Retrieve salary from shipments that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02064 | train |
v3 | Schema:
orders (alias: ord)(id, amount, date, code)
accounts(level, code, type, name)
Task: Find salary from orders where salary exceeds the count of value from accounts for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM accounts AS acct
WHERE acct.status = ord.status
); | {
"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": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02065 | train |
v3 | Schema:
regions (alias: rgn)(salary, level, name, code)
transactions(id, level, date, value)
Task: Find name from regions where value exceeds the maximum value from transactions for the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE value > (
SELECT MAX(value) FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02066 | train |
v2 | Schema:
tasks (alias: tsk)(value, level, type, salary)
staff(level, status, id, name)
Task: Retrieve salary from tasks that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02067 | train |
v2 | Schema:
shipments (alias: shp)(name, code, status, date)
accounts(date, amount, code, type)
Task: Find amount from shipments where a matching record exists in accounts with the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02068 | train |
v3 | Schema:
orders (alias: ord)(salary, value, amount, type)
accounts(code, date, level, amount)
Task: Retrieve value from orders with amount above the COUNT(amount) of accounts rows sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE amount > (
SELECT COUNT(amount) FROM accounts AS acct
WHERE acct.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02069 | train |
v2 | Schema:
accounts (alias: acct)(status, amount, code, level)
regions(type, value, code, name)
Task: Retrieve name from accounts that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02070 | train |
v2 | Schema:
staff (alias: empl)(code, id, value, salary)
regions(name, date, type, code)
Task: Find id from staff where a matching record exists in regions with the same status.
SQL: | SELECT id FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02071 | train |
v1 | Schema:
schedules (alias: schd)(id, amount, code, level)
projects(amount, level, salary, name)
Task: Retrieve name from schedules whose id is found in projects rows where status matches the outer record.
SQL: | SELECT name FROM schedules AS schd
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02072 | train |
v2 | Schema:
shipments (alias: shp)(status, level, name, type)
regions(value, status, salary, id)
Task: Retrieve value from shipments that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02073 | train |
v3 | Schema:
projects (alias: prj)(id, type, amount, value)
orders(name, date, id, value)
Task: Retrieve id from projects with amount above the AVG(amount) of orders rows sharing the same code.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT AVG(amount) FROM orders AS ord
WHERE ord.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02074 | train |
v1 | Schema:
departments (alias: dept)(id, amount, value, salary)
transactions(status, id, type, code)
Task: Select id from departments where type exists in transactions for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02075 | train |
v1 | Schema:
products (alias: prod)(salary, date, id, type)
accounts(date, level, type, status)
Task: Retrieve id from products whose level is found in accounts rows where status matches the outer record.
SQL: | SELECT id FROM products AS prod
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = prod.status
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02076 | train |
v1 | Schema:
schedules (alias: schd)(value, id, status, name)
employees(name, salary, date, type)
Task: Find salary from schedules where level appears in employees entries with matching id.
SQL: | SELECT salary FROM schedules AS schd
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02077 | train |
v1 | Schema:
invoices (alias: inv)(amount, date, id, level)
products(name, status, level, code)
Task: Find salary from invoices where type appears in products entries with matching code.
SQL: | SELECT salary FROM invoices AS inv
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02078 | train |
v3 | Schema:
regions (alias: rgn)(name, level, date, salary)
projects(code, type, date, value)
Task: Retrieve salary from regions with value above the MAX(salary) of projects rows sharing the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE value > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02079 | train |
v3 | Schema:
departments (alias: dept)(level, code, type, date)
items(status, id, date, code)
Task: Find id from departments where value exceeds the average value from items for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT AVG(value) FROM items AS lne
WHERE lne.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02080 | train |
v1 | Schema:
items (alias: lne)(type, value, name, salary)
accounts(level, name, salary, date)
Task: Select name from items where type exists in accounts for the same id.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.id = lne.id
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02081 | train |
v3 | Schema:
projects (alias: prj)(id, name, code, salary)
customers(salary, name, value, id)
Task: Find salary from projects where salary exceeds the average value from customers for the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02082 | train |
v1 | Schema:
tasks (alias: tsk)(id, name, code, salary)
customers(value, amount, id, salary)
Task: Select name from tasks where level exists in customers for the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02083 | train |
v2 | Schema:
customers (alias: cust)(amount, type, salary, value)
departments(name, level, type, salary)
Task: Find amount from customers where a matching record exists in departments with the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "departments",
"outer_alias": "cust",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02084 | train |
v2 | Schema:
items (alias: lne)(code, type, date, level)
categories(id, type, status, code)
Task: Find amount from items where a matching record exists in categories with the same type.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = lne.type
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02085 | train |
v3 | Schema:
staff (alias: empl)(name, date, salary, code)
sales(name, id, date, level)
Task: Retrieve code from staff with amount above the COUNT(value) of sales rows sharing the same code.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02086 | train |
v1 | Schema:
employees (alias: emp)(salary, name, amount, code)
regions(level, code, date, amount)
Task: Retrieve amount from employees whose id is found in regions rows where code matches the outer record.
SQL: | SELECT amount FROM employees AS emp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02087 | train |
v1 | Schema:
requests (alias: ordr)(date, amount, level, status)
projects(value, type, name, code)
Task: Find salary from requests where type appears in projects entries with matching type.
SQL: | SELECT salary FROM requests AS ordr
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02088 | train |
v3 | Schema:
requests (alias: ordr)(date, status, level, salary)
managers(amount, code, value, date)
Task: Retrieve name from requests with salary above the COUNT(amount) of managers rows sharing the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02089 | train |
v2 | Schema:
transactions (alias: txn)(amount, name, value, type)
regions(status, name, code, level)
Task: Retrieve amount from transactions that have at least one corresponding entry in regions sharing the same level.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02090 | train |
v2 | Schema:
branches (alias: brc)(type, level, value, id)
items(type, id, value, date)
Task: Find value from branches where a matching record exists in items with the same level.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02091 | train |
v2 | Schema:
categories (alias: catg)(amount, code, name, id)
orders(type, amount, name, value)
Task: Find value from categories where a matching record exists in orders with the same code.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02092 | train |
v1 | Schema:
requests (alias: ordr)(status, code, id, value)
accounts(type, code, value, salary)
Task: Find id from requests where type appears in accounts entries with matching code.
SQL: | SELECT id FROM requests AS ordr
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02093 | train |
v2 | Schema:
regions (alias: rgn)(salary, id, date, level)
schedules(salary, name, level, amount)
Task: Find value from regions where a matching record exists in schedules with the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02094 | train |
v1 | Schema:
employees (alias: emp)(status, value, salary, name)
schedules(value, name, code, status)
Task: Retrieve id from employees whose type is found in schedules rows where id matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02095 | train |
v3 | Schema:
employees (alias: emp)(name, code, status, id)
categories(type, date, salary, value)
Task: Find id from employees where amount exceeds the total value from categories for the same type.
SQL: | SELECT id FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02096 | train |
v2 | Schema:
sales (alias: sale)(amount, name, id, value)
products(code, name, id, salary)
Task: Find value from sales where a matching record exists in products with the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02097 | train |
v1 | Schema:
transactions (alias: txn)(salary, type, status, id)
invoices(date, salary, value, amount)
Task: Find salary from transactions where type appears in invoices entries with matching code.
SQL: | SELECT salary FROM transactions AS txn
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02098 | train |
v3 | Schema:
requests (alias: ordr)(date, type, code, amount)
categories(amount, salary, name, code)
Task: Find code from requests where amount exceeds the minimum salary from categories for the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.