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:
employees (alias: emp)(status, salary, name, value)
requests(value, code, id, amount)
Task: Find salary from employees where status appears in requests entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07000 | train |
v3 | Schema:
categories (alias: catg)(type, salary, value, date)
tasks(salary, amount, date, name)
Task: Find amount from categories where amount exceeds the total salary from tasks for the same status.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "tasks",
"outer_alias": "catg",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07001 | train |
v1 | Schema:
products (alias: prod)(value, salary, level, date)
regions(type, status, date, amount)
Task: Find name from products where status appears in regions entries with matching status.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = prod.status
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07002 | train |
v1 | Schema:
departments (alias: dept)(level, code, name, status)
schedules(amount, code, value, level)
Task: Select id from departments where status exists in schedules for the same status.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07003 | train |
v3 | Schema:
staff (alias: empl)(salary, value, status, code)
sales(level, amount, type, value)
Task: Retrieve id from staff with salary above the MIN(amount) of sales rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT MIN(amount) FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07004 | train |
v3 | Schema:
items (alias: lne)(level, amount, type, value)
invoices(code, amount, date, salary)
Task: Find amount from items where salary exceeds the total salary from invoices for the same id.
SQL: | SELECT amount FROM items AS lne
WHERE salary > (
SELECT SUM(salary) FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07005 | train |
v2 | Schema:
schedules (alias: schd)(level, id, salary, name)
categories(date, salary, name, value)
Task: Find amount from schedules where a matching record exists in categories with the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07006 | train |
v2 | Schema:
products (alias: prod)(value, amount, type, status)
branches(date, salary, type, amount)
Task: Find salary from products where a matching record exists in branches with the same code.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = prod.code
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07007 | train |
v3 | Schema:
employees (alias: emp)(salary, id, status, code)
staff(status, name, code, type)
Task: Retrieve code from employees with salary above the AVG(salary) of staff rows sharing the same code.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07008 | train |
v3 | Schema:
products (alias: prod)(amount, type, id, salary)
departments(type, status, level, salary)
Task: Find id from products where salary exceeds the maximum value from departments for the same id.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.id = prod.id
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07009 | train |
v2 | Schema:
employees (alias: emp)(level, amount, date, type)
categories(name, value, type, salary)
Task: Find name from employees where a matching record exists in categories with 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",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07010 | train |
v1 | Schema:
categories (alias: catg)(level, date, code, value)
products(level, type, salary, status)
Task: Retrieve value from categories whose level is found in products rows where code matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07011 | train |
v1 | Schema:
categories (alias: catg)(value, type, status, date)
transactions(amount, salary, type, value)
Task: Select salary from categories where status exists in transactions for the same code.
SQL: | SELECT salary FROM categories AS catg
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07012 | train |
v2 | Schema:
shipments (alias: shp)(salary, status, date, code)
accounts(name, type, status, value)
Task: Retrieve id from shipments that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT id 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": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07013 | train |
v1 | Schema:
employees (alias: emp)(date, salary, id, level)
branches(level, salary, id, status)
Task: Find salary from employees where code appears in branches entries with matching id.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07014 | train |
v1 | Schema:
customers (alias: cust)(id, type, date, name)
staff(status, id, name, code)
Task: Retrieve value from customers whose type is found in staff rows where level matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07015 | train |
v1 | Schema:
managers (alias: mgr)(status, value, id, type)
products(level, name, type, date)
Task: Retrieve salary from managers whose id is found in products rows where id matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE id IN (
SELECT id 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": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07016 | train |
v1 | Schema:
invoices (alias: inv)(name, type, date, amount)
branches(level, id, date, status)
Task: Retrieve salary from invoices whose status is found in branches rows where id matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07017 | train |
v1 | Schema:
customers (alias: cust)(value, name, status, salary)
managers(date, id, salary, value)
Task: Retrieve code from customers whose level is found in managers rows where type matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07018 | train |
v3 | Schema:
branches (alias: brc)(value, salary, name, status)
schedules(amount, name, code, status)
Task: Find value from branches where value exceeds the maximum value from schedules for the same status.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07019 | train |
v2 | Schema:
staff (alias: empl)(code, name, value, salary)
items(level, type, name, status)
Task: Find code from staff where a matching record exists in items with the same code.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07020 | train |
v2 | Schema:
items (alias: lne)(level, amount, value, name)
shipments(date, type, value, name)
Task: Retrieve salary from items that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = lne.type
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07021 | train |
v3 | Schema:
branches (alias: brc)(type, value, salary, id)
regions(amount, type, level, value)
Task: Find id from branches where value exceeds the count of salary from regions for the same type.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07022 | train |
v2 | Schema:
departments (alias: dept)(name, level, value, status)
managers(id, value, salary, status)
Task: Retrieve code from departments that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07023 | train |
v3 | Schema:
items (alias: lne)(name, salary, id, date)
customers(id, type, code, salary)
Task: Find salary from items where amount exceeds the minimum amount from customers for the same type.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07024 | train |
v3 | Schema:
categories (alias: catg)(status, date, name, salary)
accounts(value, status, type, level)
Task: Find code from categories where amount exceeds the count of salary from accounts for the same type.
SQL: | SELECT code FROM categories AS catg
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07025 | train |
v3 | Schema:
invoices (alias: inv)(amount, name, value, id)
categories(amount, code, id, value)
Task: Retrieve amount from invoices with amount above the COUNT(amount) of categories rows sharing the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE amount > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07026 | train |
v2 | Schema:
branches (alias: brc)(value, level, status, id)
products(type, status, id, date)
Task: Retrieve value from branches that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07027 | train |
v3 | Schema:
tasks (alias: tsk)(id, name, level, type)
staff(date, type, salary, status)
Task: Retrieve amount from tasks with amount above the MAX(salary) of staff rows sharing the same level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE amount > (
SELECT MAX(salary) FROM staff AS empl
WHERE empl.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07028 | train |
v1 | Schema:
categories (alias: catg)(id, salary, code, status)
requests(value, salary, name, date)
Task: Retrieve salary from categories whose type is found in requests rows where code matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07029 | train |
v2 | Schema:
requests (alias: ordr)(amount, date, type, salary)
shipments(status, date, code, name)
Task: Retrieve name from requests that have at least one corresponding entry in shipments sharing the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07030 | train |
v1 | Schema:
departments (alias: dept)(name, level, date, value)
accounts(amount, level, code, id)
Task: Find id from departments where level appears in accounts entries with matching code.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07031 | train |
v3 | Schema:
branches (alias: brc)(level, value, date, status)
projects(name, value, code, salary)
Task: Find name from branches where value exceeds the maximum salary from projects for the same id.
SQL: | SELECT name FROM branches AS brc
WHERE value > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07032 | train |
v1 | Schema:
requests (alias: ordr)(salary, level, date, type)
employees(salary, id, date, level)
Task: Find id from requests where level appears in employees entries with matching code.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07033 | train |
v3 | Schema:
accounts (alias: acct)(salary, amount, id, level)
regions(name, type, code, amount)
Task: Retrieve salary from accounts with amount above the MIN(salary) of regions rows sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE amount > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07034 | train |
v1 | Schema:
invoices (alias: inv)(status, value, id, salary)
shipments(salary, value, amount, date)
Task: Find name from invoices where code appears in shipments entries with matching id.
SQL: | SELECT name FROM invoices AS inv
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07035 | train |
v3 | Schema:
staff (alias: empl)(salary, name, value, amount)
items(name, amount, type, status)
Task: Find code from staff where amount exceeds the count of salary from items for the same status.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07036 | train |
v3 | Schema:
shipments (alias: shp)(level, code, name, date)
customers(amount, code, status, id)
Task: Retrieve id from shipments with value above the COUNT(salary) of customers rows sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07037 | train |
v1 | Schema:
departments (alias: dept)(code, salary, status, amount)
tasks(type, name, status, amount)
Task: Retrieve id from departments whose level is found in tasks rows where level matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07038 | train |
v1 | Schema:
departments (alias: dept)(value, type, amount, id)
tasks(amount, value, id, date)
Task: Retrieve id from departments whose level is found in tasks rows where id matches the outer record.
SQL: | SELECT id FROM departments AS dept
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07039 | train |
v1 | Schema:
managers (alias: mgr)(value, name, type, salary)
customers(code, salary, name, id)
Task: Select code from managers where id exists in customers for the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07040 | train |
v3 | Schema:
transactions (alias: txn)(amount, name, date, level)
products(value, level, code, type)
Task: Retrieve salary from transactions with amount above the AVG(amount) of products rows sharing the same level.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07041 | train |
v2 | Schema:
employees (alias: emp)(id, name, code, salary)
items(level, date, salary, value)
Task: Retrieve salary from employees that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07042 | train |
v1 | Schema:
requests (alias: ordr)(date, id, code, level)
orders(level, id, status, code)
Task: Find amount from requests where type appears in orders entries with matching code.
SQL: | SELECT amount FROM requests AS ordr
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07043 | train |
v2 | Schema:
departments (alias: dept)(name, id, salary, code)
products(amount, type, value, status)
Task: Find salary from departments where a matching record exists in products with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07044 | train |
v3 | Schema:
departments (alias: dept)(name, date, amount, code)
employees(date, salary, code, type)
Task: Retrieve amount from departments with value above the MAX(amount) of employees rows sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM employees AS emp
WHERE emp.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07045 | train |
v3 | Schema:
orders (alias: ord)(amount, code, value, type)
projects(amount, type, salary, date)
Task: Retrieve code from orders with amount above the MAX(amount) of projects rows sharing the same type.
SQL: | SELECT code FROM orders AS ord
WHERE amount > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07046 | train |
v1 | Schema:
managers (alias: mgr)(date, type, name, value)
invoices(salary, status, id, value)
Task: Find value from managers where code appears in invoices entries with matching type.
SQL: | SELECT value FROM managers AS mgr
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07047 | train |
v1 | Schema:
employees (alias: emp)(code, level, salary, value)
sales(amount, date, id, type)
Task: Retrieve amount from employees whose type is found in sales rows where type matches the outer record.
SQL: | SELECT amount FROM employees AS emp
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "emp",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07048 | train |
v1 | Schema:
departments (alias: dept)(type, amount, salary, status)
staff(value, name, code, status)
Task: Find value from departments where type appears in staff entries with matching level.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07049 | train |
v3 | Schema:
invoices (alias: inv)(id, code, name, level)
shipments(type, level, id, amount)
Task: Retrieve salary from invoices with salary above the MAX(value) of shipments rows sharing the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07050 | train |
v3 | Schema:
requests (alias: ordr)(id, date, salary, amount)
managers(salary, type, value, level)
Task: Retrieve name from requests with salary above the COUNT(amount) of managers rows sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT COUNT(amount) FROM managers AS mgr
WHERE mgr.level = ordr.level
); | {
"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": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07051 | train |
v1 | Schema:
branches (alias: brc)(id, date, type, name)
customers(level, code, amount, salary)
Task: Find value from branches where code appears in customers entries with matching status.
SQL: | SELECT value FROM branches AS brc
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07052 | train |
v3 | Schema:
regions (alias: rgn)(name, value, code, status)
schedules(amount, salary, code, type)
Task: Retrieve value from regions with value above the SUM(value) of schedules rows sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07053 | train |
v3 | Schema:
departments (alias: dept)(value, date, code, salary)
orders(amount, status, code, type)
Task: Retrieve value from departments with salary above the COUNT(value) of orders rows sharing the same id.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07054 | train |
v1 | Schema:
branches (alias: brc)(code, salary, type, status)
invoices(code, id, date, name)
Task: Retrieve amount from branches whose type is found in invoices rows where type matches the outer record.
SQL: | SELECT amount FROM branches AS brc
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07055 | train |
v3 | Schema:
items (alias: lne)(salary, name, date, level)
requests(type, salary, status, date)
Task: Find id from items where amount exceeds the maximum amount from requests for the same level.
SQL: | SELECT id FROM items AS lne
WHERE amount > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07056 | train |
v3 | Schema:
sales (alias: sale)(name, amount, type, salary)
employees(value, amount, code, date)
Task: Retrieve id from sales with value above the COUNT(value) of employees rows sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT COUNT(value) FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07057 | train |
v2 | Schema:
staff (alias: empl)(level, code, id, status)
accounts(type, salary, amount, status)
Task: Retrieve code from staff that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT code FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07058 | train |
v1 | Schema:
sales (alias: sale)(date, id, status, salary)
employees(status, code, level, name)
Task: Retrieve name from sales whose type is found in employees rows where type matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07059 | train |
v1 | Schema:
requests (alias: ordr)(value, code, name, level)
customers(salary, status, value, id)
Task: Find code from requests where code appears in customers entries with matching code.
SQL: | SELECT code FROM requests AS ordr
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07060 | train |
v2 | Schema:
departments (alias: dept)(value, date, amount, salary)
customers(value, level, date, code)
Task: Retrieve code from departments that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07061 | train |
v2 | Schema:
orders (alias: ord)(salary, name, level, code)
transactions(name, amount, level, status)
Task: Find value from orders where a matching record exists in transactions with the same code.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07062 | train |
v2 | Schema:
managers (alias: mgr)(code, id, level, type)
schedules(level, salary, status, value)
Task: Find name from managers where a matching record exists in schedules with the same type.
SQL: | SELECT name 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": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07063 | train |
v3 | Schema:
requests (alias: ordr)(code, name, value, date)
schedules(code, value, type, salary)
Task: Find salary from requests where salary exceeds the average amount from schedules for the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07064 | train |
v3 | Schema:
regions (alias: rgn)(code, salary, amount, name)
customers(type, date, salary, status)
Task: Find salary from regions where salary exceeds the average value from customers for the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_07065 | train |
v2 | Schema:
departments (alias: dept)(amount, type, date, code)
items(value, name, type, status)
Task: Find value from departments where a matching record exists in items with the same status.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07066 | train |
v1 | Schema:
managers (alias: mgr)(level, date, amount, code)
staff(amount, date, name, type)
Task: Retrieve salary from managers whose type is found in staff rows where id matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07067 | train |
v3 | Schema:
sales (alias: sale)(date, status, amount, code)
accounts(name, value, salary, status)
Task: Retrieve name from sales with value above the MAX(amount) of accounts rows sharing the same type.
SQL: | SELECT name FROM sales AS sale
WHERE value > (
SELECT MAX(amount) FROM accounts AS acct
WHERE acct.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07068 | train |
v1 | Schema:
accounts (alias: acct)(salary, date, level, amount)
departments(amount, value, salary, code)
Task: Select salary from accounts where status exists in departments for the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07069 | train |
v2 | Schema:
orders (alias: ord)(date, value, code, status)
accounts(type, code, salary, value)
Task: Find salary from orders where a matching record exists in accounts with the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07070 | train |
v1 | Schema:
items (alias: lne)(type, name, amount, value)
projects(amount, value, status, name)
Task: Retrieve code from items whose type is found in projects rows where type matches the outer record.
SQL: | SELECT code FROM items AS lne
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.type = lne.type
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07071 | train |
v1 | Schema:
items (alias: lne)(name, value, level, code)
customers(value, status, level, date)
Task: Retrieve amount from items whose id is found in customers rows where type matches the outer record.
SQL: | SELECT amount FROM items AS lne
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = lne.type
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07072 | train |
v3 | Schema:
staff (alias: empl)(name, status, level, id)
categories(salary, value, date, amount)
Task: Find amount from staff where value exceeds the maximum amount from categories for the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE value > (
SELECT MAX(amount) FROM categories AS catg
WHERE catg.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07073 | train |
v1 | Schema:
projects (alias: prj)(status, id, amount, value)
managers(salary, amount, date, status)
Task: Find value from projects where level appears in managers entries with matching level.
SQL: | SELECT value FROM projects AS prj
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07074 | train |
v3 | Schema:
accounts (alias: acct)(id, type, name, salary)
tasks(date, status, salary, amount)
Task: Find amount from accounts where value exceeds the count of salary from tasks for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07075 | train |
v3 | Schema:
orders (alias: ord)(id, level, salary, type)
transactions(value, name, code, amount)
Task: Retrieve id from orders with value above the MIN(value) of transactions rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07076 | train |
v2 | Schema:
managers (alias: mgr)(amount, code, value, date)
requests(id, type, status, level)
Task: Retrieve name from managers that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07077 | train |
v2 | Schema:
items (alias: lne)(id, name, code, type)
orders(date, level, type, id)
Task: Find salary from items where a matching record exists in orders with the same level.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = lne.level
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_07078 | train |
v1 | Schema:
branches (alias: brc)(name, id, value, amount)
projects(code, status, name, id)
Task: Find amount from branches where code appears in projects entries with matching status.
SQL: | SELECT amount FROM branches AS brc
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07079 | train |
v2 | Schema:
products (alias: prod)(amount, id, name, salary)
categories(salary, type, date, status)
Task: Find id from products where a matching record exists in categories with the same id.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = prod.id
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07080 | train |
v3 | Schema:
customers (alias: cust)(code, amount, name, type)
sales(status, level, type, id)
Task: Find value from customers where value exceeds the count of salary from sales for the same level.
SQL: | SELECT value FROM customers AS cust
WHERE value > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07081 | train |
v1 | Schema:
invoices (alias: inv)(amount, date, value, name)
staff(status, level, name, salary)
Task: Select salary from invoices where id exists in staff for the same level.
SQL: | SELECT salary FROM invoices AS inv
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07082 | train |
v3 | Schema:
transactions (alias: txn)(code, name, id, amount)
projects(value, id, code, type)
Task: Find code from transactions where value exceeds the count of value from projects for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07083 | train |
v1 | Schema:
tasks (alias: tsk)(name, level, amount, status)
branches(level, name, salary, status)
Task: Retrieve name from tasks whose status is found in branches rows where level matches the outer record.
SQL: | SELECT name FROM tasks AS tsk
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07084 | train |
v2 | Schema:
projects (alias: prj)(id, name, amount, salary)
schedules(id, date, name, status)
Task: Retrieve code from projects that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_07085 | train |
v2 | Schema:
tasks (alias: tsk)(code, level, name, status)
products(name, type, salary, date)
Task: Retrieve code from tasks that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_07086 | train |
v2 | Schema:
schedules (alias: schd)(code, value, level, salary)
accounts(id, code, date, level)
Task: Find code from schedules where a matching record exists in accounts with the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07087 | train |
v2 | Schema:
branches (alias: brc)(amount, id, type, name)
customers(status, code, level, name)
Task: Retrieve amount from branches that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_07088 | train |
v1 | Schema:
orders (alias: ord)(code, level, value, amount)
shipments(date, status, salary, value)
Task: Find value from orders where level appears in shipments entries with matching type.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07089 | train |
v2 | Schema:
managers (alias: mgr)(date, name, salary, level)
requests(name, salary, level, code)
Task: Retrieve value from managers that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07090 | train |
v1 | Schema:
orders (alias: ord)(value, salary, id, name)
shipments(type, value, salary, date)
Task: Retrieve value from orders whose level is found in shipments rows where id matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07091 | train |
v2 | Schema:
requests (alias: ordr)(salary, status, value, type)
shipments(value, level, name, id)
Task: Retrieve code from requests that have at least one corresponding entry in shipments sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07092 | train |
v1 | Schema:
requests (alias: ordr)(name, date, status, code)
sales(id, name, code, date)
Task: Select name from requests where code exists in sales for the same type.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_07093 | train |
v3 | Schema:
shipments (alias: shp)(status, amount, date, id)
categories(name, code, level, value)
Task: Find salary from shipments where amount exceeds the minimum salary from categories for the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT MIN(salary) FROM categories AS catg
WHERE catg.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_07094 | train |
v2 | Schema:
customers (alias: cust)(name, level, value, date)
branches(amount, date, status, name)
Task: Retrieve value from customers that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07095 | train |
v1 | Schema:
staff (alias: empl)(value, id, type, code)
categories(level, salary, id, amount)
Task: Find code from staff where type appears in categories entries with matching id.
SQL: | SELECT code FROM staff AS empl
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_07096 | train |
v1 | Schema:
invoices (alias: inv)(value, name, id, date)
products(type, name, salary, value)
Task: Retrieve id from invoices whose id is found in products rows where type matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07097 | train |
v3 | Schema:
transactions (alias: txn)(name, type, value, date)
departments(code, value, salary, amount)
Task: Retrieve name from transactions with value above the AVG(salary) of departments rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_07098 | train |
v2 | Schema:
categories (alias: catg)(code, type, name, amount)
accounts(id, value, code, amount)
Task: Find amount from categories where a matching record exists in accounts with the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "accounts",
"outer_alias": "catg",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_07099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.