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:
projects (alias: prj)(salary, value, code, id)
departments(status, value, date, type)
Task: Retrieve amount from projects that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11900 | train |
v2 | Schema:
tasks (alias: tsk)(status, level, type, value)
employees(level, name, date, amount)
Task: Retrieve name from tasks that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11901 | train |
v1 | Schema:
orders (alias: ord)(id, status, value, type)
sales(code, amount, id, type)
Task: Find amount from orders where status appears in sales entries with matching type.
SQL: | SELECT amount FROM orders AS ord
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11902 | train |
v1 | Schema:
departments (alias: dept)(value, name, date, id)
customers(salary, id, amount, type)
Task: Retrieve value from departments whose code is found in customers rows where id matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11903 | train |
v1 | Schema:
tasks (alias: tsk)(value, amount, type, date)
sales(status, type, date, value)
Task: Select code from tasks where id exists in sales for the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11904 | train |
v2 | Schema:
staff (alias: empl)(code, salary, date, type)
transactions(value, salary, date, code)
Task: Find name from staff where a matching record exists in transactions with the same code.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "transactions",
"outer_alias": "empl",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11905 | train |
v2 | Schema:
requests (alias: ordr)(status, type, name, date)
accounts(date, amount, status, id)
Task: Retrieve id from requests that have at least one corresponding entry in accounts sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11906 | train |
v1 | Schema:
sales (alias: sale)(date, name, amount, type)
categories(type, date, level, id)
Task: Retrieve id from sales whose level is found in categories rows where type matches the outer record.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM categories AS catg
WHERE catg.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11907 | train |
v1 | Schema:
products (alias: prod)(status, code, date, name)
sales(value, id, amount, status)
Task: Select value from products where level exists in sales for the same level.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.level = prod.level
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11908 | train |
v1 | Schema:
invoices (alias: inv)(amount, status, value, date)
requests(level, code, name, date)
Task: Select value from invoices where type exists in requests for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "requests",
"outer_alias": "inv",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11909 | train |
v1 | Schema:
branches (alias: brc)(id, type, value, salary)
requests(date, level, amount, id)
Task: Find code from branches where id appears in requests entries with matching type.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11910 | train |
v2 | Schema:
sales (alias: sale)(value, id, level, salary)
accounts(code, type, value, id)
Task: Retrieve value from sales that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11911 | train |
v2 | Schema:
products (alias: prod)(code, value, level, type)
regions(level, status, date, code)
Task: Find value from products where a matching record exists in regions with the same id.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = prod.id
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11912 | train |
v1 | Schema:
staff (alias: empl)(date, id, type, salary)
accounts(amount, code, level, date)
Task: Retrieve name from staff whose type is found in accounts rows where status matches the outer record.
SQL: | SELECT name FROM staff AS empl
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "empl",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11913 | train |
v1 | Schema:
regions (alias: rgn)(level, type, value, id)
branches(level, code, name, amount)
Task: Retrieve code from regions whose level is found in branches rows where status matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11914 | train |
v3 | Schema:
customers (alias: cust)(salary, id, type, level)
categories(date, level, amount, id)
Task: Find id from customers where value exceeds the total amount from categories for the same level.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11915 | train |
v3 | Schema:
invoices (alias: inv)(level, status, amount, salary)
schedules(amount, salary, code, level)
Task: Retrieve value from invoices with amount above the SUM(value) of schedules rows sharing the same status.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11916 | train |
v3 | Schema:
schedules (alias: schd)(name, id, salary, status)
projects(level, salary, amount, status)
Task: Find salary from schedules where value exceeds the count of value from projects for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11917 | train |
v1 | Schema:
transactions (alias: txn)(name, type, value, code)
customers(salary, type, name, status)
Task: Retrieve name from transactions whose level is found in customers rows where code matches the outer record.
SQL: | SELECT name FROM transactions AS txn
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11918 | train |
v3 | Schema:
sales (alias: sale)(status, level, amount, code)
items(salary, id, name, type)
Task: Retrieve id from sales with value above the SUM(amount) of items rows sharing the same type.
SQL: | SELECT id FROM sales AS sale
WHERE value > (
SELECT SUM(amount) FROM items AS lne
WHERE lne.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11919 | train |
v1 | Schema:
tasks (alias: tsk)(id, name, type, level)
sales(level, name, date, type)
Task: Select code from tasks where status exists in sales for the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11920 | train |
v3 | Schema:
products (alias: prod)(code, amount, type, name)
customers(name, amount, id, type)
Task: Find salary from products where value exceeds the minimum value from customers for the same type.
SQL: | SELECT salary FROM products AS prod
WHERE value > (
SELECT MIN(value) FROM customers AS cust
WHERE cust.type = prod.type
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11921 | train |
v3 | Schema:
orders (alias: ord)(code, date, salary, status)
branches(value, id, name, level)
Task: Retrieve id from orders with amount above the SUM(salary) of branches rows sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE amount > (
SELECT SUM(salary) FROM branches AS brc
WHERE brc.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11922 | train |
v1 | Schema:
requests (alias: ordr)(date, name, amount, type)
staff(date, id, salary, type)
Task: Retrieve amount from requests whose status is found in staff rows where status matches the outer record.
SQL: | SELECT amount FROM requests AS ordr
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11923 | train |
v3 | Schema:
departments (alias: dept)(code, name, amount, type)
accounts(salary, date, name, amount)
Task: Find code from departments where amount exceeds the total value from accounts for the same id.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11924 | train |
v1 | Schema:
categories (alias: catg)(id, code, value, date)
items(id, date, type, amount)
Task: Retrieve id from categories whose level is found in items rows where code matches the outer record.
SQL: | SELECT id FROM categories AS catg
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11925 | train |
v3 | Schema:
products (alias: prod)(code, id, date, amount)
shipments(id, salary, amount, status)
Task: Find code from products where value exceeds the minimum salary from shipments for the same id.
SQL: | SELECT code FROM products AS prod
WHERE value > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11926 | train |
v3 | Schema:
categories (alias: catg)(level, date, id, status)
managers(type, level, code, salary)
Task: Find id from categories where value exceeds the minimum value from managers for the same type.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11927 | train |
v1 | Schema:
accounts (alias: acct)(date, value, salary, amount)
departments(value, amount, status, salary)
Task: Retrieve name from accounts whose status is found in departments rows where type matches the outer record.
SQL: | SELECT name FROM accounts AS acct
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "acct",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11928 | train |
v1 | Schema:
invoices (alias: inv)(amount, value, type, status)
products(value, status, code, name)
Task: Select amount from invoices where type exists in products for the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11929 | train |
v2 | Schema:
employees (alias: emp)(value, status, id, name)
regions(level, status, salary, type)
Task: Find code from employees where a matching record exists in regions with the same level.
SQL: | SELECT code FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "emp",
"inner_alias": "rgn",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11930 | train |
v1 | Schema:
projects (alias: prj)(amount, status, name, date)
employees(id, amount, value, code)
Task: Select id from projects where status exists in employees for the same status.
SQL: | SELECT id FROM projects AS prj
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11931 | train |
v3 | Schema:
departments (alias: dept)(code, type, value, level)
staff(code, value, name, level)
Task: Find code from departments where salary exceeds the minimum amount from staff for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE salary > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11932 | train |
v2 | Schema:
products (alias: prod)(id, level, salary, code)
invoices(code, amount, status, id)
Task: Find code from products where a matching record exists in invoices with the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = prod.status
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11933 | train |
v2 | Schema:
products (alias: prod)(salary, id, name, date)
projects(code, id, name, type)
Task: Retrieve code from products that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = prod.status
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11934 | train |
v2 | Schema:
branches (alias: brc)(level, amount, status, salary)
managers(type, salary, level, name)
Task: Find salary from branches where a matching record exists in managers with the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "managers",
"outer_alias": "brc",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11935 | train |
v2 | Schema:
schedules (alias: schd)(salary, level, id, value)
sales(value, salary, type, status)
Task: Find code from schedules where a matching record exists in sales with the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11936 | train |
v1 | Schema:
managers (alias: mgr)(amount, id, salary, level)
shipments(name, status, date, code)
Task: Retrieve id from managers whose level is found in shipments rows where code matches the outer record.
SQL: | SELECT id FROM managers AS mgr
WHERE level IN (
SELECT level FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11937 | train |
v3 | Schema:
customers (alias: cust)(value, level, name, code)
invoices(name, type, status, date)
Task: Retrieve amount from customers with value above the SUM(amount) of invoices rows sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE value > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11938 | train |
v2 | Schema:
shipments (alias: shp)(amount, status, name, level)
transactions(code, amount, type, id)
Task: Retrieve id from shipments that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11939 | train |
v2 | Schema:
orders (alias: ord)(amount, value, salary, type)
staff(date, salary, level, name)
Task: Find code from orders where a matching record exists in staff with the same type.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11940 | train |
v2 | Schema:
items (alias: lne)(id, amount, date, type)
customers(id, date, code, status)
Task: Retrieve name from items that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = lne.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11941 | train |
v2 | Schema:
transactions (alias: txn)(salary, type, date, code)
products(salary, date, code, status)
Task: Retrieve code from transactions that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11942 | train |
v3 | Schema:
staff (alias: empl)(salary, amount, date, status)
managers(salary, date, level, id)
Task: Find value from staff where amount exceeds the minimum salary from managers for the same level.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11943 | train |
v2 | Schema:
projects (alias: prj)(type, date, status, id)
regions(level, salary, code, value)
Task: Find name from projects where a matching record exists in regions with the same type.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "regions",
"outer_alias": "prj",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11944 | train |
v3 | Schema:
staff (alias: empl)(name, salary, status, date)
customers(amount, salary, id, date)
Task: Find amount from staff where amount exceeds the total salary from customers for the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11945 | train |
v3 | Schema:
departments (alias: dept)(value, code, level, amount)
items(code, level, id, amount)
Task: Retrieve id from departments with value above the MIN(value) of items rows sharing the same type.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT MIN(value) FROM items AS lne
WHERE lne.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11946 | train |
v1 | Schema:
regions (alias: rgn)(value, name, salary, status)
managers(code, salary, status, amount)
Task: Retrieve code from regions whose status is found in managers rows where id matches the outer record.
SQL: | SELECT code FROM regions AS rgn
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11947 | train |
v3 | Schema:
tasks (alias: tsk)(name, date, amount, level)
branches(amount, id, code, type)
Task: Find salary from tasks where amount exceeds the minimum amount from branches for the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE amount > (
SELECT MIN(amount) FROM branches AS brc
WHERE brc.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11948 | train |
v1 | Schema:
categories (alias: catg)(value, level, date, status)
branches(name, salary, amount, type)
Task: Select name from categories where code exists in branches for the same type.
SQL: | SELECT name FROM categories AS catg
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11949 | train |
v1 | Schema:
products (alias: prod)(level, id, amount, date)
managers(amount, code, level, date)
Task: Find amount from products where status appears in managers entries with matching id.
SQL: | SELECT amount FROM products AS prod
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11950 | train |
v3 | Schema:
departments (alias: dept)(date, id, name, amount)
tasks(id, code, value, date)
Task: Find id from departments where value exceeds the count of salary from tasks for the same level.
SQL: | SELECT id FROM departments AS dept
WHERE value > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11951 | train |
v2 | Schema:
invoices (alias: inv)(code, date, type, level)
shipments(type, date, level, id)
Task: Find amount from invoices where a matching record exists in shipments with the same level.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11952 | train |
v1 | Schema:
categories (alias: catg)(code, date, salary, id)
sales(status, type, date, name)
Task: Find salary from categories where status appears in sales entries with matching type.
SQL: | SELECT salary FROM categories AS catg
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11953 | train |
v3 | Schema:
branches (alias: brc)(name, code, type, level)
invoices(status, name, level, salary)
Task: Find amount from branches where salary exceeds the minimum salary from invoices for the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11954 | train |
v2 | Schema:
staff (alias: empl)(value, date, level, name)
products(level, name, amount, type)
Task: Find value from staff where a matching record exists in products with the same status.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11955 | train |
v3 | Schema:
shipments (alias: shp)(id, code, level, date)
projects(code, salary, level, type)
Task: Find code from shipments where amount exceeds the total salary from projects for the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE amount > (
SELECT SUM(salary) FROM projects AS prj
WHERE prj.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11956 | train |
v3 | Schema:
sales (alias: sale)(type, salary, name, level)
regions(value, status, name, type)
Task: Retrieve salary from sales with value above the MAX(salary) of regions rows sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT MAX(salary) FROM regions AS rgn
WHERE rgn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "sale",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11957 | train |
v3 | Schema:
categories (alias: catg)(id, salary, code, type)
transactions(id, type, name, status)
Task: Retrieve salary from categories with value above the AVG(salary) of transactions rows sharing the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT AVG(salary) FROM transactions AS txn
WHERE txn.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11958 | train |
v2 | Schema:
invoices (alias: inv)(salary, id, value, date)
branches(status, salary, level, amount)
Task: Retrieve code from invoices that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11959 | train |
v3 | Schema:
projects (alias: prj)(name, value, type, salary)
shipments(value, type, amount, id)
Task: Retrieve value from projects with amount above the MAX(amount) of shipments rows sharing the same type.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "shipments",
"outer_alias": "prj",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11960 | train |
v2 | Schema:
branches (alias: brc)(level, id, code, amount)
categories(value, id, type, name)
Task: Find value from branches where a matching record exists in categories with the same id.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11961 | train |
v1 | Schema:
regions (alias: rgn)(salary, type, status, code)
shipments(value, level, status, name)
Task: Select salary from regions where type exists in shipments for the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "rgn",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11962 | train |
v2 | Schema:
requests (alias: ordr)(level, salary, id, amount)
items(amount, status, name, type)
Task: Retrieve code from requests that have at least one corresponding entry in items sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11963 | train |
v3 | Schema:
products (alias: prod)(code, amount, level, type)
orders(status, name, value, date)
Task: Find id from products where salary exceeds the maximum amount from orders for the same id.
SQL: | SELECT id FROM products AS prod
WHERE salary > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.id = prod.id
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11964 | train |
v2 | Schema:
regions (alias: rgn)(date, name, value, id)
orders(level, status, type, code)
Task: Find value from regions where a matching record exists in orders with the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_11965 | train |
v1 | Schema:
customers (alias: cust)(amount, status, date, id)
accounts(code, date, status, level)
Task: Find name from customers where status appears in accounts entries with matching level.
SQL: | SELECT name FROM customers AS cust
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11966 | train |
v2 | Schema:
tasks (alias: tsk)(level, id, amount, type)
projects(name, amount, date, value)
Task: Find value from tasks where a matching record exists in projects with the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11967 | train |
v2 | Schema:
shipments (alias: shp)(value, date, code, type)
orders(type, level, code, id)
Task: Retrieve name from shipments that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11968 | train |
v3 | Schema:
branches (alias: brc)(status, amount, name, date)
shipments(status, salary, value, date)
Task: Retrieve amount from branches with value above the MIN(value) of shipments rows sharing the same status.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT MIN(value) FROM shipments AS shp
WHERE shp.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11969 | train |
v3 | Schema:
branches (alias: brc)(value, status, code, salary)
requests(date, status, code, value)
Task: Find value from branches where value exceeds the average salary from requests for the same status.
SQL: | SELECT value FROM branches AS brc
WHERE value > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11970 | train |
v3 | Schema:
projects (alias: prj)(status, code, value, date)
schedules(level, salary, amount, status)
Task: Find value from projects where value exceeds the maximum amount from schedules for the same status.
SQL: | SELECT value FROM projects AS prj
WHERE value > (
SELECT MAX(amount) FROM schedules AS schd
WHERE schd.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11971 | train |
v1 | Schema:
tasks (alias: tsk)(type, code, amount, value)
orders(value, name, amount, type)
Task: Select name from tasks where status exists in orders for the same code.
SQL: | SELECT name FROM tasks AS tsk
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11972 | train |
v1 | Schema:
tasks (alias: tsk)(id, value, date, status)
categories(name, id, value, type)
Task: Select name from tasks where code exists in categories for the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11973 | train |
v3 | Schema:
shipments (alias: shp)(name, type, salary, value)
projects(amount, code, id, salary)
Task: Retrieve id from shipments with salary above the SUM(amount) of projects rows sharing the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11974 | train |
v3 | Schema:
requests (alias: ordr)(date, code, amount, level)
departments(type, code, id, value)
Task: Retrieve code from requests with value above the AVG(salary) of departments rows sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE value > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11975 | train |
v3 | Schema:
customers (alias: cust)(name, salary, status, value)
tasks(salary, name, type, status)
Task: Retrieve amount from customers with amount above the SUM(value) of tasks rows sharing the same level.
SQL: | SELECT amount FROM customers AS cust
WHERE amount > (
SELECT SUM(value) FROM tasks AS tsk
WHERE tsk.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11976 | train |
v1 | Schema:
items (alias: lne)(date, salary, id, status)
orders(date, amount, name, id)
Task: Select amount from items where level exists in orders for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11977 | train |
v2 | Schema:
invoices (alias: inv)(name, status, code, level)
departments(value, date, amount, status)
Task: Retrieve salary from invoices that have at least one corresponding entry in departments sharing 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_11978 | train |
v3 | Schema:
items (alias: lne)(status, date, value, id)
products(value, name, code, id)
Task: Retrieve value from items with amount above the AVG(amount) of products rows sharing the same type.
SQL: | SELECT value FROM items AS lne
WHERE amount > (
SELECT AVG(amount) FROM products AS prod
WHERE prod.type = lne.type
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "lne",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11979 | train |
v2 | Schema:
staff (alias: empl)(code, id, level, amount)
shipments(amount, value, type, level)
Task: Retrieve amount from staff that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11980 | train |
v3 | Schema:
invoices (alias: inv)(date, value, id, salary)
customers(code, type, level, salary)
Task: Retrieve id from invoices with amount above the MAX(amount) of customers rows sharing the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11981 | train |
v3 | Schema:
employees (alias: emp)(status, date, name, level)
requests(level, type, code, status)
Task: Find code from employees where value exceeds the total value from requests for the same id.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11982 | train |
v1 | Schema:
staff (alias: empl)(type, status, code, date)
customers(name, status, code, value)
Task: Find name from staff where code appears in customers entries with matching id.
SQL: | SELECT name FROM staff AS empl
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "empl",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11983 | train |
v1 | Schema:
accounts (alias: acct)(salary, name, amount, date)
items(date, code, level, amount)
Task: Select amount from accounts where status exists in items for the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11984 | train |
v2 | Schema:
employees (alias: emp)(level, code, salary, name)
departments(code, name, date, id)
Task: Find amount from employees where a matching record exists in departments with the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11985 | train |
v1 | Schema:
categories (alias: catg)(code, status, value, level)
orders(type, value, amount, code)
Task: Select id from categories where level exists in orders for the same type.
SQL: | SELECT id FROM categories AS catg
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11986 | train |
v3 | Schema:
employees (alias: emp)(amount, status, type, value)
managers(amount, level, value, type)
Task: Find value from employees where amount exceeds the minimum salary from managers for the same type.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT MIN(salary) FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11987 | train |
v2 | Schema:
departments (alias: dept)(status, value, id, amount)
customers(amount, status, name, date)
Task: Find salary from departments where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11988 | train |
v3 | Schema:
items (alias: lne)(amount, name, type, salary)
requests(type, date, name, amount)
Task: Retrieve name from items with amount above the MAX(value) of requests rows sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.id = lne.id
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11989 | train |
v3 | Schema:
products (alias: prod)(status, amount, salary, name)
customers(amount, date, salary, name)
Task: Retrieve salary from products with salary above the MAX(value) of customers rows sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT MAX(value) FROM customers AS cust
WHERE cust.id = prod.id
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11990 | train |
v1 | Schema:
shipments (alias: shp)(name, level, id, type)
projects(code, value, type, status)
Task: Select amount from shipments where level exists in projects for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11991 | train |
v1 | Schema:
products (alias: prod)(level, date, type, name)
employees(status, date, salary, id)
Task: Retrieve code from products whose status is found in employees rows where id matches the outer record.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.id = prod.id
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11992 | train |
v1 | Schema:
invoices (alias: inv)(salary, type, code, amount)
branches(amount, status, date, salary)
Task: Retrieve code from invoices whose id is found in branches rows where status matches the outer record.
SQL: | SELECT code FROM invoices AS inv
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11993 | train |
v3 | Schema:
shipments (alias: shp)(salary, status, date, id)
sales(level, amount, value, status)
Task: Find id from shipments where value exceeds the count of value from sales for the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE value > (
SELECT COUNT(value) FROM sales AS sale
WHERE sale.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11994 | train |
v1 | Schema:
orders (alias: ord)(value, salary, id, name)
employees(value, id, type, code)
Task: Retrieve id from orders whose status is found in employees rows where type matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11995 | train |
v3 | Schema:
sales (alias: sale)(id, code, status, amount)
departments(value, type, amount, level)
Task: Find code from sales where salary exceeds the count of salary from departments for the same status.
SQL: | SELECT code FROM sales AS sale
WHERE salary > (
SELECT COUNT(salary) FROM departments AS dept
WHERE dept.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11996 | train |
v2 | Schema:
projects (alias: prj)(id, level, status, value)
managers(id, date, type, value)
Task: Find amount from projects where a matching record exists in managers with the same type.
SQL: | SELECT amount 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": "amount",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11997 | train |
v2 | Schema:
categories (alias: catg)(amount, value, date, type)
invoices(value, type, salary, status)
Task: Retrieve id from categories that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11998 | train |
v2 | Schema:
transactions (alias: txn)(level, type, salary, amount)
categories(date, type, value, id)
Task: Retrieve salary from transactions that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.