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 |
|---|---|---|---|---|---|---|
v2 | Schema:
invoices (alias: inv)(type, date, value, name)
departments(value, code, level, id)
Task: Retrieve code from invoices that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10000 | train |
v2 | Schema:
projects (alias: prj)(name, status, id, type)
requests(id, level, salary, code)
Task: Retrieve code from projects that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "requests",
"outer_alias": "prj",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10001 | train |
v3 | Schema:
projects (alias: prj)(date, type, level, id)
managers(type, value, code, level)
Task: Find id from projects where amount exceeds the minimum salary from managers for the same id.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10002 | train |
v1 | Schema:
items (alias: lne)(level, salary, name, date)
accounts(salary, id, name, type)
Task: Find id from items where status appears in accounts entries with matching status.
SQL: | SELECT id FROM items AS lne
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.status = lne.status
); | {
"outer_table": "items",
"inner_table": "accounts",
"outer_alias": "lne",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10003 | train |
v1 | Schema:
departments (alias: dept)(code, value, amount, type)
sales(date, status, type, name)
Task: Retrieve name from departments whose id is found in sales rows where level matches the outer record.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10004 | train |
v3 | Schema:
tasks (alias: tsk)(level, type, salary, date)
orders(id, level, name, status)
Task: Find amount from tasks where value exceeds the average value from orders for the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE value > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10005 | train |
v3 | Schema:
sales (alias: sale)(salary, code, amount, date)
categories(salary, status, code, name)
Task: Find name from sales where salary exceeds the maximum salary from categories for the same type.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT MAX(salary) FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10006 | train |
v3 | Schema:
accounts (alias: acct)(status, level, value, salary)
customers(date, type, amount, status)
Task: Retrieve salary from accounts with salary above the MAX(salary) of customers rows sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE salary > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10007 | train |
v3 | Schema:
projects (alias: prj)(id, amount, name, status)
managers(date, id, salary, value)
Task: Find id from projects where amount exceeds the maximum amount from managers for the same level.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10008 | train |
v3 | Schema:
sales (alias: sale)(level, id, status, salary)
shipments(id, value, salary, level)
Task: Find value from sales where value exceeds the maximum value from shipments for the same status.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MAX(value) FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10009 | train |
v1 | Schema:
schedules (alias: schd)(status, date, salary, id)
branches(type, salary, amount, date)
Task: Retrieve code from schedules whose level is found in branches rows where status matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10010 | train |
v3 | Schema:
sales (alias: sale)(amount, status, code, value)
items(value, salary, level, amount)
Task: Retrieve name from sales with amount above the MIN(amount) of items rows sharing the same status.
SQL: | SELECT name FROM sales AS sale
WHERE amount > (
SELECT MIN(amount) FROM items AS lne
WHERE lne.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10011 | train |
v2 | Schema:
sales (alias: sale)(date, type, id, status)
accounts(amount, status, date, id)
Task: Find salary from sales where a matching record exists in accounts with the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10012 | train |
v2 | Schema:
orders (alias: ord)(id, status, salary, level)
items(salary, amount, level, value)
Task: Find amount from orders where a matching record exists in items with the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10013 | train |
v2 | Schema:
shipments (alias: shp)(salary, amount, status, value)
invoices(id, type, value, amount)
Task: Retrieve code from shipments that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10014 | train |
v3 | Schema:
transactions (alias: txn)(type, level, status, date)
categories(id, status, value, level)
Task: Retrieve salary from transactions with value above the COUNT(salary) of categories rows sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE value > (
SELECT COUNT(salary) FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10015 | train |
v2 | Schema:
shipments (alias: shp)(type, date, value, salary)
branches(value, status, type, salary)
Task: Retrieve id from shipments that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10016 | train |
v3 | Schema:
orders (alias: ord)(name, level, salary, amount)
departments(status, salary, amount, code)
Task: Find value from orders where value exceeds the count of amount from departments for the same status.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10017 | train |
v1 | Schema:
staff (alias: empl)(type, salary, value, status)
sales(id, value, type, code)
Task: Select value from staff where code exists in sales for the same code.
SQL: | SELECT value FROM staff AS empl
WHERE code IN (
SELECT code 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": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10018 | train |
v2 | Schema:
invoices (alias: inv)(status, type, amount, level)
departments(id, salary, amount, status)
Task: Find salary from invoices where a matching record exists in departments with the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10019 | train |
v3 | Schema:
products (alias: prod)(id, level, status, name)
customers(status, name, value, amount)
Task: Find name from products where salary exceeds the maximum salary from customers for the same id.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.id = prod.id
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10020 | train |
v3 | Schema:
items (alias: lne)(status, date, amount, name)
sales(name, level, value, type)
Task: Retrieve salary from items with amount above the MIN(value) of sales rows sharing the same code.
SQL: | SELECT salary FROM items AS lne
WHERE amount > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.code = lne.code
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "lne",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10021 | train |
v1 | Schema:
items (alias: lne)(code, name, salary, date)
orders(salary, amount, date, level)
Task: Find name from items where level appears in orders entries with matching type.
SQL: | SELECT name FROM items AS lne
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = lne.type
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10022 | train |
v1 | Schema:
items (alias: lne)(amount, name, date, status)
invoices(amount, type, value, level)
Task: Find id from items where type appears in invoices entries with matching type.
SQL: | SELECT id FROM items AS lne
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.type = lne.type
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10023 | train |
v3 | Schema:
categories (alias: catg)(value, level, status, code)
requests(amount, level, name, salary)
Task: Find salary from categories where amount exceeds the maximum amount from requests for the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE amount > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10024 | train |
v3 | Schema:
branches (alias: brc)(date, type, id, salary)
regions(amount, type, date, status)
Task: Retrieve code from branches with value above the MIN(salary) of regions rows sharing the same id.
SQL: | SELECT code FROM branches AS brc
WHERE value > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10025 | train |
v2 | Schema:
categories (alias: catg)(value, level, amount, id)
orders(status, level, date, code)
Task: Retrieve code from categories that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10026 | train |
v2 | Schema:
sales (alias: sale)(salary, amount, level, status)
invoices(type, date, level, status)
Task: Retrieve salary from sales that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10027 | train |
v1 | Schema:
customers (alias: cust)(salary, value, date, level)
products(amount, value, name, date)
Task: Find salary from customers where code appears in products entries with matching code.
SQL: | SELECT salary FROM customers AS cust
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10028 | train |
v2 | Schema:
departments (alias: dept)(salary, value, id, name)
orders(level, salary, status, code)
Task: Retrieve value from departments that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10029 | train |
v3 | Schema:
employees (alias: emp)(date, salary, level, status)
customers(id, date, type, status)
Task: Retrieve value from employees with salary above the COUNT(salary) of customers rows sharing the same level.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10030 | train |
v1 | Schema:
categories (alias: catg)(name, level, salary, date)
schedules(type, code, date, id)
Task: Retrieve code from categories whose id is found in schedules rows where level matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10031 | train |
v1 | Schema:
shipments (alias: shp)(code, level, salary, date)
sales(type, value, id, status)
Task: Select id from shipments where status exists in sales for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10032 | train |
v2 | Schema:
departments (alias: dept)(id, code, status, salary)
accounts(salary, id, level, code)
Task: Find value from departments where a matching record exists in accounts with the same code.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10033 | train |
v2 | Schema:
shipments (alias: shp)(salary, code, status, amount)
branches(amount, code, date, status)
Task: Find salary from shipments where a matching record exists in branches with the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10034 | train |
v1 | Schema:
schedules (alias: schd)(name, date, type, value)
projects(date, salary, amount, id)
Task: Select code from schedules where id exists in projects for the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10035 | train |
v3 | Schema:
schedules (alias: schd)(code, type, date, level)
projects(status, code, type, name)
Task: Retrieve name from schedules with salary above the AVG(salary) of projects rows sharing the same level.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10036 | train |
v1 | Schema:
accounts (alias: acct)(id, amount, name, date)
tasks(date, id, code, status)
Task: Select amount from accounts where level exists in tasks for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE level IN (
SELECT level 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": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10037 | train |
v3 | Schema:
regions (alias: rgn)(date, salary, value, id)
branches(status, amount, value, code)
Task: Retrieve value from regions with value above the AVG(salary) of branches rows sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE value > (
SELECT AVG(salary) FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10038 | train |
v1 | Schema:
managers (alias: mgr)(date, value, name, code)
items(amount, salary, date, value)
Task: Select amount from managers where level exists in items for the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10039 | train |
v3 | Schema:
managers (alias: mgr)(level, amount, id, date)
requests(code, level, date, name)
Task: Retrieve amount from managers with salary above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10040 | train |
v2 | Schema:
staff (alias: empl)(status, name, salary, type)
orders(value, date, code, level)
Task: Find name from staff where a matching record exists in orders with the same status.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10041 | train |
v2 | Schema:
projects (alias: prj)(code, salary, amount, value)
products(date, salary, code, amount)
Task: Retrieve value from projects that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10042 | train |
v1 | Schema:
managers (alias: mgr)(id, type, amount, code)
sales(code, id, name, amount)
Task: Select id from managers where code exists in sales for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE code IN (
SELECT code FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10043 | train |
v3 | Schema:
employees (alias: emp)(level, type, amount, date)
managers(status, name, amount, salary)
Task: Retrieve value from employees with amount above the SUM(value) of managers rows sharing the same status.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10044 | train |
v2 | Schema:
departments (alias: dept)(date, name, level, id)
managers(amount, value, id, type)
Task: Retrieve value from departments that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT value 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": "value",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10045 | train |
v2 | Schema:
sales (alias: sale)(amount, level, date, value)
regions(level, value, date, amount)
Task: Find value from sales where a matching record exists in regions with the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10046 | train |
v2 | Schema:
transactions (alias: txn)(date, code, salary, id)
departments(type, date, level, amount)
Task: Retrieve id from transactions that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10047 | train |
v2 | Schema:
accounts (alias: acct)(date, type, id, level)
customers(status, code, id, date)
Task: Retrieve salary from accounts that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10048 | train |
v1 | Schema:
staff (alias: empl)(level, code, date, status)
managers(status, name, date, amount)
Task: Select salary from staff where status exists in managers for the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10049 | train |
v3 | Schema:
branches (alias: brc)(status, salary, code, date)
invoices(value, type, id, level)
Task: Retrieve salary from branches with value above the MAX(value) of invoices rows sharing the same status.
SQL: | SELECT salary FROM branches AS brc
WHERE value > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "salary",
"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_10050 | train |
v2 | Schema:
departments (alias: dept)(value, level, salary, date)
tasks(name, value, salary, type)
Task: Retrieve value from departments that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10051 | train |
v2 | Schema:
products (alias: prod)(salary, type, name, amount)
items(type, value, level, name)
Task: Find name from products where a matching record exists in items with the same type.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = prod.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10052 | train |
v3 | Schema:
regions (alias: rgn)(salary, type, date, id)
products(type, name, salary, amount)
Task: Retrieve amount from regions with value above the AVG(amount) of products rows sharing the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE value > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10053 | train |
v2 | Schema:
orders (alias: ord)(status, name, id, salary)
branches(value, amount, date, salary)
Task: Find name from orders where a matching record exists in branches with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10054 | train |
v2 | Schema:
staff (alias: empl)(type, level, salary, date)
employees(level, status, code, value)
Task: Find salary from staff where a matching record exists in employees with the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10055 | train |
v2 | Schema:
projects (alias: prj)(code, amount, id, date)
staff(salary, amount, status, id)
Task: Find code from projects where a matching record exists in staff with the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10056 | train |
v3 | Schema:
orders (alias: ord)(name, date, salary, level)
sales(date, salary, id, code)
Task: Retrieve amount from orders with salary above the COUNT(value) of sales rows sharing the same level.
SQL: | SELECT amount FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10057 | train |
v3 | Schema:
schedules (alias: schd)(salary, name, amount, value)
projects(date, type, salary, level)
Task: Retrieve amount from schedules with value above the MIN(salary) of projects rows sharing the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE value > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10058 | train |
v1 | Schema:
customers (alias: cust)(status, code, type, amount)
orders(level, code, value, name)
Task: Retrieve salary from customers whose code is found in orders rows where type matches the outer record.
SQL: | SELECT salary FROM customers AS cust
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10059 | train |
v3 | Schema:
regions (alias: rgn)(name, id, salary, type)
branches(name, code, date, level)
Task: Find amount from regions where salary exceeds the maximum salary from branches for the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10060 | train |
v1 | Schema:
schedules (alias: schd)(id, type, amount, status)
categories(status, value, code, level)
Task: Retrieve amount from schedules whose type is found in categories rows where status matches the outer record.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10061 | train |
v3 | Schema:
schedules (alias: schd)(salary, code, name, date)
projects(code, level, amount, value)
Task: Find value from schedules where amount exceeds the average value from projects for the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE amount > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10062 | train |
v3 | Schema:
employees (alias: emp)(type, amount, date, status)
accounts(date, amount, level, status)
Task: Retrieve name from employees with value above the SUM(value) of accounts rows sharing the same status.
SQL: | SELECT name FROM employees AS emp
WHERE value > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10063 | train |
v1 | Schema:
regions (alias: rgn)(date, code, status, id)
customers(level, code, salary, amount)
Task: Find value from regions where id appears in customers entries with matching level.
SQL: | SELECT value FROM regions AS rgn
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10064 | train |
v3 | Schema:
requests (alias: ordr)(code, date, amount, value)
accounts(value, status, type, id)
Task: Retrieve salary from requests with salary above the AVG(value) of accounts rows sharing the same level.
SQL: | SELECT salary FROM requests AS ordr
WHERE salary > (
SELECT AVG(value) FROM accounts AS acct
WHERE acct.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10065 | train |
v2 | Schema:
branches (alias: brc)(salary, code, value, status)
sales(status, salary, amount, id)
Task: Find name from branches where a matching record exists in sales with the same status.
SQL: | SELECT name FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10066 | train |
v2 | Schema:
transactions (alias: txn)(date, level, id, salary)
tasks(status, amount, value, name)
Task: Find code from transactions where a matching record exists in tasks with the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "tasks",
"outer_alias": "txn",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10067 | train |
v2 | Schema:
departments (alias: dept)(name, level, value, salary)
categories(name, id, date, value)
Task: Retrieve salary from departments that have at least one corresponding entry in categories sharing the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10068 | train |
v2 | Schema:
items (alias: lne)(name, id, code, value)
schedules(date, salary, type, id)
Task: Retrieve amount from items that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = lne.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10069 | train |
v2 | Schema:
requests (alias: ordr)(status, type, salary, level)
tasks(name, code, date, level)
Task: Find salary from requests where a matching record exists in tasks with the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10070 | train |
v2 | Schema:
invoices (alias: inv)(salary, type, status, value)
staff(salary, code, id, type)
Task: Retrieve name from invoices that have at least one corresponding entry in staff sharing the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10071 | train |
v2 | Schema:
branches (alias: brc)(name, code, salary, status)
regions(date, amount, value, id)
Task: Find amount from branches where a matching record exists in regions with the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10072 | train |
v3 | Schema:
departments (alias: dept)(code, type, name, salary)
products(salary, date, type, status)
Task: Retrieve value from departments with amount above the MIN(salary) of products rows sharing the same code.
SQL: | SELECT value FROM departments AS dept
WHERE amount > (
SELECT MIN(salary) FROM products AS prod
WHERE prod.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10073 | train |
v3 | Schema:
products (alias: prod)(id, code, type, level)
employees(id, value, type, code)
Task: Retrieve id from products with amount above the SUM(amount) of employees rows sharing the same id.
SQL: | SELECT id FROM products AS prod
WHERE amount > (
SELECT SUM(amount) FROM employees AS emp
WHERE emp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10074 | train |
v2 | Schema:
accounts (alias: acct)(amount, level, salary, value)
categories(date, code, name, status)
Task: Find id from accounts where a matching record exists in categories with the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "categories",
"outer_alias": "acct",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10075 | train |
v2 | Schema:
accounts (alias: acct)(date, value, amount, status)
employees(date, code, salary, type)
Task: Retrieve salary from accounts that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT salary FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10076 | train |
v3 | Schema:
schedules (alias: schd)(value, type, code, id)
transactions(amount, status, level, type)
Task: Retrieve code from schedules with salary above the MIN(amount) of transactions rows sharing the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE salary > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10077 | train |
v2 | Schema:
orders (alias: ord)(level, id, status, type)
tasks(type, code, level, salary)
Task: Retrieve code from orders that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10078 | train |
v2 | Schema:
projects (alias: prj)(status, date, type, id)
invoices(date, level, type, id)
Task: Find name from projects where a matching record exists in invoices with the same id.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10079 | train |
v3 | Schema:
sales (alias: sale)(value, status, name, amount)
managers(status, salary, value, amount)
Task: Retrieve value from sales with salary above the AVG(salary) of managers rows sharing the same status.
SQL: | SELECT value FROM sales AS sale
WHERE salary > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10080 | train |
v3 | Schema:
employees (alias: emp)(amount, code, salary, value)
invoices(code, type, status, salary)
Task: Find amount from employees where salary exceeds the minimum salary from invoices for the same status.
SQL: | SELECT amount FROM employees AS emp
WHERE salary > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10081 | train |
v2 | Schema:
sales (alias: sale)(type, level, id, name)
orders(status, id, level, amount)
Task: Retrieve code from sales that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10082 | train |
v2 | Schema:
projects (alias: prj)(name, amount, level, id)
regions(name, salary, type, id)
Task: Retrieve value from projects that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10083 | train |
v1 | Schema:
customers (alias: cust)(status, code, level, amount)
accounts(level, type, code, date)
Task: Retrieve code from customers whose code is found in accounts rows where level matches the outer record.
SQL: | SELECT code FROM customers AS cust
WHERE code IN (
SELECT code FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10084 | train |
v3 | Schema:
customers (alias: cust)(type, date, code, salary)
employees(type, value, name, level)
Task: Find name from customers where salary exceeds the minimum amount from employees for the same status.
SQL: | SELECT name FROM customers AS cust
WHERE salary > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10085 | train |
v1 | Schema:
products (alias: prod)(name, amount, code, level)
customers(code, name, amount, id)
Task: Find value from products where id appears in customers entries with matching code.
SQL: | SELECT value FROM products AS prod
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10086 | train |
v2 | Schema:
shipments (alias: shp)(value, level, date, status)
items(status, salary, id, level)
Task: Retrieve id from shipments that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10087 | train |
v2 | Schema:
shipments (alias: shp)(status, type, code, date)
products(value, id, salary, type)
Task: Find amount from shipments where a matching record exists in products with the same id.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10088 | train |
v1 | Schema:
projects (alias: prj)(id, status, salary, type)
categories(name, salary, amount, date)
Task: Find name from projects where type appears in categories entries with matching type.
SQL: | SELECT name FROM projects AS prj
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "categories",
"outer_alias": "prj",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10089 | train |
v1 | Schema:
shipments (alias: shp)(salary, name, date, value)
requests(id, status, date, code)
Task: Find amount from shipments where type appears in requests entries with matching status.
SQL: | SELECT amount FROM shipments AS shp
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "shp",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10090 | train |
v3 | Schema:
regions (alias: rgn)(name, status, value, id)
transactions(date, level, code, type)
Task: Retrieve salary from regions with amount above the COUNT(amount) of transactions rows sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10091 | train |
v2 | Schema:
regions (alias: rgn)(code, type, name, salary)
staff(name, status, level, amount)
Task: Find name from regions where a matching record exists in staff with the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10092 | train |
v1 | Schema:
projects (alias: prj)(value, id, salary, name)
transactions(amount, level, id, value)
Task: Find salary from projects where code appears in transactions entries with matching status.
SQL: | SELECT salary FROM projects AS prj
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10093 | train |
v2 | Schema:
schedules (alias: schd)(code, id, name, value)
employees(salary, amount, status, name)
Task: Find value from schedules where a matching record exists in employees with the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "schd",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10094 | train |
v1 | Schema:
requests (alias: ordr)(name, status, id, code)
branches(code, type, date, level)
Task: Find code from requests where level appears in branches entries with matching id.
SQL: | SELECT code FROM requests AS ordr
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10095 | train |
v3 | Schema:
requests (alias: ordr)(salary, value, status, code)
transactions(level, code, id, name)
Task: Find value from requests where salary exceeds the average salary from transactions for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE salary > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10096 | train |
v3 | Schema:
products (alias: prod)(name, amount, date, salary)
projects(level, id, status, name)
Task: Find name from products where salary exceeds the minimum salary from projects for the same code.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.code = prod.code
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10097 | train |
v2 | Schema:
tasks (alias: tsk)(status, level, salary, name)
schedules(status, date, salary, name)
Task: Find id from tasks where a matching record exists in schedules with the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "schedules",
"outer_alias": "tsk",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10098 | train |
v1 | Schema:
invoices (alias: inv)(level, code, status, date)
staff(id, name, code, date)
Task: Retrieve amount from invoices whose status is found in staff rows where id matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.