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 |
|---|---|---|---|---|---|---|
v3 | Schema:
invoices (alias: inv)(date, amount, id, value)
tasks(salary, name, status, id)
Task: Find code from invoices where value exceeds the minimum value from tasks for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT MIN(value) FROM tasks AS tsk
WHERE tsk.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00900 | train |
v2 | Schema:
tasks (alias: tsk)(date, amount, value, salary)
products(status, level, name, salary)
Task: Find code from tasks where a matching record exists in products with 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_00901 | train |
v1 | Schema:
regions (alias: rgn)(salary, type, date, value)
items(status, date, id, salary)
Task: Retrieve amount from regions whose code is found in items rows where type matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00902 | train |
v2 | Schema:
customers (alias: cust)(salary, value, code, amount)
categories(salary, name, date, value)
Task: Find code from customers where a matching record exists in categories with the same id.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00903 | train |
v2 | Schema:
departments (alias: dept)(code, value, status, name)
customers(value, name, date, id)
Task: Find value from departments where a matching record exists in customers with the same level.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00904 | train |
v1 | Schema:
projects (alias: prj)(id, code, salary, amount)
items(type, name, amount, date)
Task: Find amount from projects where type appears in items entries with matching id.
SQL: | SELECT amount FROM projects AS prj
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00905 | train |
v2 | Schema:
shipments (alias: shp)(amount, name, level, date)
staff(date, level, code, status)
Task: Retrieve code from shipments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00906 | train |
v2 | Schema:
projects (alias: prj)(date, salary, name, type)
transactions(status, code, name, amount)
Task: Find id from projects where a matching record exists in transactions with the same status.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00907 | train |
v3 | Schema:
products (alias: prod)(date, name, code, type)
sales(level, type, value, date)
Task: Retrieve id from products with salary above the SUM(salary) of sales rows sharing the same id.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = prod.id
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00908 | train |
v1 | Schema:
branches (alias: brc)(value, level, id, name)
departments(date, name, level, salary)
Task: Find name from branches where type appears in departments entries with matching status.
SQL: | SELECT name FROM branches AS brc
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00909 | train |
v3 | Schema:
customers (alias: cust)(date, name, amount, salary)
managers(status, date, value, type)
Task: Find id from customers where amount exceeds the maximum salary from managers for the same code.
SQL: | SELECT id FROM customers AS cust
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00910 | train |
v3 | Schema:
branches (alias: brc)(type, salary, id, name)
items(date, value, name, status)
Task: Find amount from branches where salary exceeds the total value from items for the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT SUM(value) FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00911 | train |
v1 | Schema:
branches (alias: brc)(date, amount, name, id)
accounts(level, name, id, value)
Task: Retrieve value from branches whose status is found in accounts rows where level matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00912 | train |
v2 | Schema:
sales (alias: sale)(amount, id, date, value)
products(amount, salary, date, id)
Task: Find salary from sales where a matching record exists in products with the same code.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00913 | train |
v2 | Schema:
accounts (alias: acct)(value, amount, code, status)
employees(value, amount, code, status)
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_00914 | train |
v3 | Schema:
employees (alias: emp)(name, type, id, status)
customers(status, level, id, date)
Task: Retrieve value from employees with amount above the MIN(amount) of customers rows sharing the same code.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00915 | train |
v3 | Schema:
items (alias: lne)(type, id, level, name)
requests(value, id, date, status)
Task: Find value from items where value exceeds the minimum salary from requests for the same status.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MIN(salary) FROM requests AS ordr
WHERE ordr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00916 | train |
v2 | Schema:
orders (alias: ord)(name, code, id, level)
transactions(level, amount, value, date)
Task: Retrieve code from orders that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00917 | train |
v2 | Schema:
orders (alias: ord)(type, date, salary, status)
tasks(type, salary, name, status)
Task: Find value from orders where a matching record exists in tasks with the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00918 | train |
v2 | Schema:
departments (alias: dept)(date, value, amount, type)
transactions(status, level, amount, id)
Task: Retrieve name from departments that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00919 | train |
v1 | Schema:
categories (alias: catg)(level, id, date, code)
managers(code, level, type, name)
Task: Retrieve amount from categories whose type is found in managers rows where level matches the outer record.
SQL: | SELECT amount FROM categories AS catg
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00920 | train |
v2 | Schema:
categories (alias: catg)(amount, value, date, level)
requests(date, amount, id, code)
Task: Retrieve code from categories that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00921 | train |
v2 | Schema:
transactions (alias: txn)(id, amount, status, level)
customers(id, status, code, type)
Task: Find amount from transactions where a matching record exists in customers with the same type.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00922 | train |
v1 | Schema:
categories (alias: catg)(code, status, salary, name)
staff(date, code, level, value)
Task: Find amount from categories where id appears in staff entries with matching id.
SQL: | SELECT amount FROM categories AS catg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00923 | train |
v1 | Schema:
branches (alias: brc)(amount, name, salary, date)
projects(id, code, value, type)
Task: Select amount from branches where level exists in projects for the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00924 | train |
v2 | Schema:
categories (alias: catg)(amount, value, date, status)
sales(id, amount, date, status)
Task: Find salary from categories where a matching record exists in sales with the same status.
SQL: | SELECT salary FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00925 | train |
v2 | Schema:
tasks (alias: tsk)(date, type, value, code)
sales(salary, date, level, status)
Task: Retrieve name from tasks that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00926 | train |
v3 | Schema:
employees (alias: emp)(code, salary, level, status)
requests(salary, amount, value, status)
Task: Find code from employees where salary exceeds the average amount from requests for the same status.
SQL: | SELECT code FROM employees AS emp
WHERE salary > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00927 | train |
v3 | Schema:
employees (alias: emp)(status, id, value, type)
categories(name, amount, type, status)
Task: Retrieve value from employees with value above the COUNT(amount) of categories rows sharing the same status.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00928 | train |
v2 | Schema:
sales (alias: sale)(salary, id, code, value)
branches(id, code, amount, date)
Task: Find code from sales where a matching record exists in branches with the same level.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00929 | train |
v1 | Schema:
shipments (alias: shp)(name, status, amount, type)
projects(code, level, status, id)
Task: Retrieve value from shipments whose level is found in projects rows where id matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00930 | train |
v1 | Schema:
transactions (alias: txn)(code, status, value, level)
shipments(level, amount, salary, date)
Task: Retrieve amount from transactions whose id is found in shipments rows where id matches the outer record.
SQL: | SELECT amount FROM transactions AS txn
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "txn",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00931 | train |
v1 | Schema:
managers (alias: mgr)(name, code, id, amount)
schedules(id, status, amount, value)
Task: Find id from managers where level appears in schedules entries with matching type.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00932 | train |
v1 | Schema:
staff (alias: empl)(amount, value, id, status)
items(value, salary, level, date)
Task: Retrieve value from staff whose status is found in items rows where type matches the outer record.
SQL: | SELECT value FROM staff AS empl
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00933 | train |
v1 | Schema:
invoices (alias: inv)(salary, date, level, type)
customers(type, value, level, salary)
Task: Select name from invoices where id exists in customers for the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00934 | train |
v2 | Schema:
accounts (alias: acct)(id, status, value, salary)
schedules(name, id, salary, type)
Task: Find amount from accounts where a matching record exists in schedules with the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00935 | train |
v1 | Schema:
departments (alias: dept)(amount, id, date, type)
accounts(date, salary, level, name)
Task: Select salary from departments where level exists in accounts for the same status.
SQL: | SELECT salary FROM departments AS dept
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00936 | train |
v1 | Schema:
managers (alias: mgr)(type, id, code, date)
staff(id, name, date, value)
Task: Find value from managers where status appears in staff entries with matching level.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00937 | train |
v1 | Schema:
schedules (alias: schd)(level, name, value, date)
invoices(amount, type, value, level)
Task: Select id from schedules where code exists in invoices for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE code IN (
SELECT code FROM invoices AS inv
WHERE inv.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00938 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, type, name)
invoices(status, type, amount, code)
Task: Retrieve name from transactions with amount above the COUNT(amount) of invoices rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE amount > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00939 | train |
v3 | Schema:
requests (alias: ordr)(status, code, value, name)
transactions(id, value, status, amount)
Task: Retrieve amount from requests with amount above the COUNT(amount) of transactions rows sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT COUNT(amount) FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00940 | train |
v2 | Schema:
transactions (alias: txn)(status, name, id, type)
accounts(salary, status, code, amount)
Task: Retrieve id from transactions that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "txn",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00941 | train |
v3 | Schema:
schedules (alias: schd)(code, value, type, id)
shipments(status, salary, name, id)
Task: Find id from schedules where salary exceeds the total amount from shipments for the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00942 | train |
v1 | Schema:
regions (alias: rgn)(status, id, salary, amount)
products(value, type, level, salary)
Task: Retrieve amount from regions whose code is found in products rows where level matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00943 | train |
v2 | Schema:
accounts (alias: acct)(date, amount, level, id)
items(code, name, amount, salary)
Task: Find value from accounts where a matching record exists in items with the same level.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00944 | train |
v2 | Schema:
orders (alias: ord)(name, value, amount, status)
shipments(amount, status, type, name)
Task: Retrieve name from orders that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "shipments",
"outer_alias": "ord",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00945 | train |
v1 | Schema:
projects (alias: prj)(salary, type, status, amount)
invoices(date, status, level, name)
Task: Retrieve code from projects whose id is found in invoices rows where status matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00946 | train |
v3 | Schema:
tasks (alias: tsk)(level, salary, date, name)
invoices(amount, code, salary, id)
Task: Find value from tasks where salary exceeds the count of value from invoices for the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(value) FROM invoices AS inv
WHERE inv.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00947 | train |
v3 | Schema:
branches (alias: brc)(status, type, value, date)
regions(salary, value, name, amount)
Task: Retrieve value from branches with salary above the AVG(value) of regions rows sharing the same code.
SQL: | SELECT value FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM regions AS rgn
WHERE rgn.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00948 | train |
v1 | Schema:
items (alias: lne)(code, id, value, type)
customers(id, salary, name, type)
Task: Select code from items where status exists in customers for the same code.
SQL: | SELECT code FROM items AS lne
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = lne.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00949 | train |
v2 | Schema:
regions (alias: rgn)(amount, status, id, type)
customers(name, type, status, salary)
Task: Retrieve value from regions that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00950 | train |
v1 | Schema:
items (alias: lne)(value, type, name, id)
categories(name, amount, value, salary)
Task: Select value from items where level exists in categories for the same level.
SQL: | SELECT value FROM items AS lne
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00951 | train |
v1 | Schema:
employees (alias: emp)(level, type, amount, name)
schedules(id, amount, value, type)
Task: Find salary from employees where level appears in schedules entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00952 | train |
v1 | Schema:
customers (alias: cust)(name, id, salary, status)
categories(salary, id, type, status)
Task: Find value from customers where type appears in categories entries with matching level.
SQL: | SELECT value FROM customers AS cust
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00953 | train |
v2 | Schema:
departments (alias: dept)(amount, status, level, date)
schedules(amount, date, id, level)
Task: Find amount from departments where a matching record exists in schedules with the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00954 | train |
v2 | Schema:
employees (alias: emp)(level, id, type, salary)
tasks(salary, amount, type, status)
Task: Retrieve salary from employees that have at least one corresponding entry in tasks sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00955 | train |
v3 | Schema:
regions (alias: rgn)(date, status, id, level)
tasks(id, amount, status, date)
Task: Find id from regions where amount exceeds the count of salary from tasks for the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00956 | train |
v1 | Schema:
managers (alias: mgr)(id, name, value, amount)
accounts(type, id, amount, date)
Task: Find value from managers where level appears in accounts entries with matching type.
SQL: | SELECT value FROM managers AS mgr
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00957 | train |
v1 | Schema:
products (alias: prod)(salary, value, type, status)
sales(id, type, code, date)
Task: Select amount from products where status exists in sales for the same code.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.code = prod.code
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00958 | train |
v2 | Schema:
projects (alias: prj)(value, level, status, id)
managers(date, type, code, amount)
Task: Retrieve name from projects that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00959 | train |
v2 | Schema:
transactions (alias: txn)(level, name, salary, id)
schedules(type, amount, code, id)
Task: Retrieve value from transactions that have at least one corresponding entry in schedules sharing the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00960 | train |
v1 | Schema:
requests (alias: ordr)(id, level, name, amount)
categories(name, type, id, level)
Task: Find amount from requests where code appears in categories entries with matching status.
SQL: | SELECT amount FROM requests AS ordr
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00961 | train |
v2 | Schema:
accounts (alias: acct)(date, code, amount, value)
employees(name, level, salary, id)
Task: Find id from accounts where a matching record exists in employees with the same type.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00962 | train |
v1 | Schema:
schedules (alias: schd)(date, status, code, amount)
transactions(type, amount, name, code)
Task: Select code from schedules where code exists in transactions for the same level.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM transactions AS txn
WHERE txn.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00963 | train |
v2 | Schema:
regions (alias: rgn)(date, name, salary, type)
branches(value, id, amount, code)
Task: Find id from regions where a matching record exists in branches with the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00964 | train |
v1 | Schema:
requests (alias: ordr)(code, type, date, name)
products(salary, value, level, id)
Task: Find amount from requests where level appears in products entries with matching type.
SQL: | SELECT amount FROM requests AS ordr
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00965 | train |
v1 | Schema:
invoices (alias: inv)(salary, id, name, level)
regions(id, level, type, code)
Task: Retrieve code from invoices whose code is found in regions rows where level matches the outer record.
SQL: | SELECT code FROM invoices AS inv
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00966 | train |
v1 | Schema:
branches (alias: brc)(amount, code, level, name)
sales(level, date, name, value)
Task: Find id from branches where id appears in sales entries with matching id.
SQL: | SELECT id FROM branches AS brc
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "sales",
"outer_alias": "brc",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00967 | train |
v2 | Schema:
staff (alias: empl)(level, id, code, amount)
schedules(code, salary, level, value)
Task: Retrieve salary from staff that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00968 | train |
v3 | Schema:
orders (alias: ord)(amount, id, date, code)
shipments(date, salary, status, type)
Task: Retrieve value from orders with salary above the MAX(value) of shipments rows sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT MAX(value) 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": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00969 | train |
v2 | Schema:
regions (alias: rgn)(level, date, salary, name)
categories(status, date, amount, type)
Task: Retrieve amount from regions that have at least one corresponding entry in categories sharing the same level.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00970 | train |
v3 | Schema:
orders (alias: ord)(code, level, type, amount)
schedules(status, date, salary, type)
Task: Find salary from orders where amount exceeds the minimum value from schedules for the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT MIN(value) FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00971 | train |
v1 | Schema:
tasks (alias: tsk)(status, type, id, value)
staff(status, code, value, type)
Task: Find salary from tasks where status appears in staff entries with matching status.
SQL: | SELECT salary FROM tasks AS tsk
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00972 | train |
v3 | Schema:
transactions (alias: txn)(code, type, salary, value)
departments(amount, code, name, salary)
Task: Retrieve value from transactions with amount above the AVG(salary) of departments rows sharing the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
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": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00973 | train |
v2 | Schema:
employees (alias: emp)(salary, value, type, status)
managers(salary, code, id, amount)
Task: Find value from employees where a matching record exists in managers with the same id.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00974 | train |
v1 | Schema:
orders (alias: ord)(level, salary, status, id)
departments(value, status, type, amount)
Task: Select id from orders where level exists in departments for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00975 | train |
v3 | Schema:
orders (alias: ord)(name, code, date, value)
items(id, level, amount, type)
Task: Retrieve name from orders with value above the SUM(salary) of items rows sharing the same level.
SQL: | SELECT name FROM orders AS ord
WHERE value > (
SELECT SUM(salary) FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00976 | train |
v2 | Schema:
accounts (alias: acct)(level, date, id, name)
employees(id, status, value, amount)
Task: Find code from accounts where a matching record exists in employees with the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00977 | train |
v1 | Schema:
managers (alias: mgr)(salary, status, amount, date)
branches(name, salary, type, amount)
Task: Find value from managers where type appears in branches entries with matching status.
SQL: | SELECT value FROM managers AS mgr
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00978 | train |
v3 | Schema:
orders (alias: ord)(amount, type, id, value)
projects(amount, code, name, type)
Task: Retrieve id from orders with value above the MIN(salary) of projects rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MIN(salary) FROM projects AS prj
WHERE prj.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00979 | train |
v2 | Schema:
schedules (alias: schd)(salary, status, id, value)
accounts(type, code, id, value)
Task: Find id from schedules where a matching record exists in accounts with the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00980 | train |
v2 | Schema:
tasks (alias: tsk)(name, date, code, status)
products(amount, level, type, salary)
Task: Retrieve value from tasks that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00981 | train |
v3 | Schema:
requests (alias: ordr)(code, date, name, status)
transactions(id, code, type, name)
Task: Find code from requests where value exceeds the minimum value from transactions for the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT MIN(value) FROM transactions AS txn
WHERE txn.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00982 | train |
v3 | Schema:
categories (alias: catg)(code, status, date, name)
branches(status, id, code, name)
Task: Retrieve code from categories with salary above the COUNT(value) of branches rows sharing the same status.
SQL: | SELECT code FROM categories AS catg
WHERE salary > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00983 | train |
v2 | Schema:
orders (alias: ord)(type, level, salary, status)
staff(status, name, amount, value)
Task: Find code from orders where a matching record exists in staff with the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00984 | train |
v2 | Schema:
customers (alias: cust)(date, salary, code, name)
projects(amount, date, type, code)
Task: Find amount from customers where a matching record exists in projects with the same code.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00985 | train |
v1 | Schema:
projects (alias: prj)(status, level, type, id)
accounts(name, value, date, amount)
Task: Retrieve salary from projects whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM projects AS prj
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00986 | train |
v1 | Schema:
accounts (alias: acct)(amount, type, salary, status)
tasks(level, id, status, code)
Task: Find salary from accounts where status appears in tasks entries with matching type.
SQL: | SELECT salary FROM accounts AS acct
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00987 | train |
v3 | Schema:
regions (alias: rgn)(value, amount, code, id)
sales(date, status, value, amount)
Task: Retrieve id from regions with amount above the MIN(salary) of sales rows sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM sales AS sale
WHERE sale.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00988 | train |
v1 | Schema:
sales (alias: sale)(date, amount, value, id)
invoices(salary, type, value, id)
Task: Find value from sales where id appears in invoices entries with matching level.
SQL: | SELECT value FROM sales AS sale
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00989 | train |
v2 | Schema:
employees (alias: emp)(name, salary, amount, code)
items(amount, status, date, code)
Task: Retrieve id from employees that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "items",
"outer_alias": "emp",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00990 | train |
v3 | Schema:
items (alias: lne)(type, date, code, status)
schedules(date, value, status, name)
Task: Retrieve name from items with salary above the SUM(amount) of schedules rows sharing the same type.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.type = lne.type
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00991 | train |
v2 | Schema:
projects (alias: prj)(id, code, value, status)
shipments(level, status, amount, type)
Task: Find amount from projects where a matching record exists in shipments with the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00992 | train |
v1 | Schema:
customers (alias: cust)(date, name, code, level)
managers(level, amount, date, salary)
Task: Select id from customers where type exists in managers for the same level.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00993 | train |
v1 | Schema:
employees (alias: emp)(type, name, date, status)
customers(salary, value, type, status)
Task: Retrieve value from employees whose id is found in customers rows where status matches the outer record.
SQL: | SELECT value FROM employees AS emp
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00994 | train |
v3 | Schema:
branches (alias: brc)(level, name, amount, status)
projects(date, id, level, status)
Task: Find code from branches where amount exceeds the average salary from projects for the same status.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT AVG(salary) FROM projects AS prj
WHERE prj.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00995 | train |
v2 | Schema:
managers (alias: mgr)(value, salary, date, name)
orders(amount, id, code, value)
Task: Retrieve id from managers that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00996 | train |
v2 | Schema:
branches (alias: brc)(value, status, salary, date)
employees(status, type, name, salary)
Task: Find value from branches where a matching record exists in employees with the same type.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00997 | train |
v3 | Schema:
items (alias: lne)(value, id, name, salary)
requests(value, code, id, type)
Task: Find name from items where salary exceeds the maximum value from requests for the same type.
SQL: | SELECT name FROM items AS lne
WHERE salary > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.type = lne.type
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00998 | train |
v3 | Schema:
orders (alias: ord)(code, type, salary, level)
requests(level, id, date, amount)
Task: Retrieve id from orders with amount above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.