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:
customers (alias: cust)(salary, amount, type, value)
requests(status, level, amount, id)
Task: Retrieve value from customers with salary above the AVG(salary) of requests rows sharing the same level.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03900 | train |
v2 | Schema:
projects (alias: prj)(type, amount, salary, status)
invoices(type, name, level, id)
Task: Find code from projects where a matching record exists in invoices with the same code.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03901 | train |
v2 | Schema:
schedules (alias: schd)(level, date, status, code)
orders(name, amount, status, date)
Task: Find value from schedules where a matching record exists in orders with the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03902 | train |
v2 | Schema:
schedules (alias: schd)(value, salary, date, status)
invoices(amount, code, date, value)
Task: Retrieve id from schedules that have at least one corresponding entry in invoices sharing the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03903 | train |
v2 | Schema:
tasks (alias: tsk)(value, level, salary, date)
customers(level, date, status, amount)
Task: Find salary from tasks where a matching record exists in customers with the same code.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03904 | train |
v2 | Schema:
requests (alias: ordr)(status, value, date, id)
categories(amount, type, status, name)
Task: Retrieve salary from requests that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03905 | train |
v1 | Schema:
regions (alias: rgn)(status, date, code, value)
categories(type, date, amount, id)
Task: Retrieve id from regions whose code is found in categories rows where code matches the outer record.
SQL: | SELECT id FROM regions AS rgn
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03906 | train |
v3 | Schema:
shipments (alias: shp)(status, level, id, date)
accounts(salary, level, status, code)
Task: Retrieve salary from shipments with amount above the MIN(amount) of accounts rows sharing the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03907 | train |
v2 | Schema:
invoices (alias: inv)(amount, id, status, value)
items(salary, date, code, status)
Task: Find value from invoices where a matching record exists in items with the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03908 | train |
v2 | Schema:
invoices (alias: inv)(value, amount, level, code)
products(id, amount, salary, code)
Task: Find salary from invoices where a matching record exists in products with the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03909 | train |
v2 | Schema:
requests (alias: ordr)(type, code, salary, level)
managers(status, code, amount, date)
Task: Retrieve salary from requests that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "managers",
"outer_alias": "ordr",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03910 | train |
v3 | Schema:
projects (alias: prj)(amount, type, id, date)
schedules(status, value, amount, name)
Task: Find value from projects where amount exceeds the maximum salary from schedules for the same code.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT MAX(salary) FROM schedules AS schd
WHERE schd.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03911 | train |
v2 | Schema:
items (alias: lne)(amount, type, status, value)
tasks(status, amount, name, code)
Task: Find value from items where a matching record exists in tasks with the same code.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = lne.code
); | {
"outer_table": "items",
"inner_table": "tasks",
"outer_alias": "lne",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03912 | train |
v2 | Schema:
branches (alias: brc)(salary, type, status, level)
requests(date, level, value, id)
Task: Retrieve salary from branches that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT salary FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03913 | train |
v2 | Schema:
customers (alias: cust)(salary, type, status, code)
tasks(id, level, name, value)
Task: Find amount from customers where a matching record exists in tasks with the same type.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03914 | train |
v1 | Schema:
categories (alias: catg)(level, salary, status, type)
transactions(salary, level, code, amount)
Task: Retrieve name from categories whose id is found in transactions rows where level matches the outer record.
SQL: | SELECT name FROM categories AS catg
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "transactions",
"outer_alias": "catg",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03915 | train |
v2 | Schema:
regions (alias: rgn)(level, date, amount, name)
accounts(id, date, value, type)
Task: Retrieve name from regions that have at least one corresponding entry in accounts sharing the same status.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03916 | train |
v3 | Schema:
categories (alias: catg)(salary, amount, level, date)
requests(name, type, value, amount)
Task: Find salary from categories where value exceeds the total value from requests for the same type.
SQL: | SELECT salary FROM categories AS catg
WHERE value > (
SELECT SUM(value) FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03917 | train |
v2 | Schema:
invoices (alias: inv)(amount, name, level, status)
staff(id, value, status, amount)
Task: Find name from invoices where a matching record exists in staff with the same status.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03918 | train |
v1 | Schema:
schedules (alias: schd)(level, salary, code, status)
transactions(date, value, name, level)
Task: Select amount from schedules where type exists in transactions for the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03919 | train |
v1 | Schema:
orders (alias: ord)(status, type, id, amount)
sales(type, status, value, level)
Task: Retrieve amount from orders whose status is found in sales rows where type matches the outer record.
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_03920 | train |
v3 | Schema:
items (alias: lne)(type, code, level, value)
transactions(level, date, value, id)
Task: Retrieve code from items with value above the MIN(amount) of transactions rows sharing the same status.
SQL: | SELECT code FROM items AS lne
WHERE value > (
SELECT MIN(amount) FROM transactions AS txn
WHERE txn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03921 | train |
v1 | Schema:
products (alias: prod)(value, level, date, type)
managers(status, code, date, salary)
Task: Find code from products where status appears in managers entries with matching status.
SQL: | SELECT code FROM products AS prod
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.status = prod.status
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03922 | train |
v3 | Schema:
invoices (alias: inv)(status, amount, type, name)
shipments(status, type, code, date)
Task: Find salary from invoices where value exceeds the minimum salary from shipments for the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT MIN(salary) FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03923 | train |
v1 | Schema:
items (alias: lne)(level, value, salary, status)
projects(salary, name, value, id)
Task: Select amount from items where status exists in projects for the same status.
SQL: | SELECT amount FROM items AS lne
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.status = lne.status
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03924 | train |
v1 | Schema:
schedules (alias: schd)(value, date, name, code)
accounts(level, id, type, status)
Task: Find value from schedules where type appears in accounts entries with matching level.
SQL: | SELECT value FROM schedules AS schd
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03925 | train |
v2 | Schema:
branches (alias: brc)(type, salary, id, level)
items(date, id, name, level)
Task: Find id from branches where a matching record exists in items with the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03926 | train |
v1 | Schema:
managers (alias: mgr)(value, status, code, id)
shipments(id, type, level, salary)
Task: Retrieve value from managers whose status is found in shipments rows where status matches the outer record.
SQL: | SELECT value FROM managers AS mgr
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03927 | train |
v3 | Schema:
accounts (alias: acct)(name, date, salary, level)
staff(amount, status, name, id)
Task: Find name from accounts where salary exceeds the minimum salary from staff for the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03928 | train |
v2 | Schema:
regions (alias: rgn)(type, status, amount, date)
accounts(name, amount, salary, level)
Task: Retrieve salary from regions that have at least one corresponding entry in accounts sharing the same code.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03929 | train |
v1 | Schema:
employees (alias: emp)(amount, code, name, date)
departments(salary, name, amount, level)
Task: Retrieve id from employees whose id is found in departments rows where level matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03930 | train |
v3 | Schema:
employees (alias: emp)(status, salary, type, value)
invoices(salary, level, code, value)
Task: Retrieve id from employees with value above the MAX(amount) of invoices rows sharing the same id.
SQL: | SELECT id FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03931 | train |
v1 | Schema:
products (alias: prod)(salary, amount, id, date)
accounts(status, date, name, code)
Task: Retrieve name from products whose type is found in accounts rows where code matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = prod.code
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03932 | train |
v1 | Schema:
accounts (alias: acct)(amount, status, id, value)
projects(name, salary, amount, level)
Task: Select value from accounts where code exists in projects for the same type.
SQL: | SELECT value FROM accounts AS acct
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03933 | train |
v3 | Schema:
products (alias: prod)(value, salary, level, id)
managers(value, amount, date, name)
Task: Find id from products where value exceeds the maximum salary from managers for the same level.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03934 | train |
v3 | Schema:
categories (alias: catg)(salary, status, level, value)
shipments(value, type, status, code)
Task: Find name from categories where salary exceeds the maximum amount from shipments for the same id.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM shipments AS shp
WHERE shp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "catg",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03935 | train |
v1 | Schema:
regions (alias: rgn)(status, salary, name, amount)
orders(salary, type, date, level)
Task: Select code from regions where code exists in orders for the same id.
SQL: | SELECT code FROM regions AS rgn
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03936 | train |
v1 | Schema:
schedules (alias: schd)(id, type, code, amount)
shipments(value, salary, amount, type)
Task: Select id from schedules where type exists in shipments for the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE type IN (
SELECT type FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03937 | train |
v2 | Schema:
shipments (alias: shp)(status, date, value, salary)
transactions(type, amount, name, date)
Task: Find amount from shipments where a matching record exists in transactions with the same type.
SQL: | SELECT amount 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": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03938 | train |
v3 | Schema:
shipments (alias: shp)(value, level, name, id)
items(code, type, status, salary)
Task: Retrieve salary from shipments with value above the MAX(salary) of items rows sharing the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03939 | train |
v2 | Schema:
schedules (alias: schd)(salary, level, value, type)
requests(type, value, level, salary)
Task: Find amount from schedules where a matching record exists in requests with the same id.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03940 | train |
v2 | Schema:
items (alias: lne)(name, type, date, salary)
shipments(name, type, date, amount)
Task: Find value from items where a matching record exists in shipments with the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = lne.status
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03941 | train |
v3 | Schema:
invoices (alias: inv)(type, code, id, value)
schedules(code, status, amount, salary)
Task: Retrieve salary from invoices with value above the COUNT(amount) of schedules rows sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE value > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03942 | train |
v3 | Schema:
shipments (alias: shp)(date, amount, value, type)
accounts(salary, value, id, amount)
Task: Find salary from shipments where value exceeds the average amount from accounts for the same code.
SQL: | SELECT salary FROM shipments AS shp
WHERE value > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03943 | train |
v1 | Schema:
orders (alias: ord)(name, status, salary, amount)
requests(value, date, salary, name)
Task: Find value from orders where id appears in requests entries with matching code.
SQL: | SELECT value FROM orders AS ord
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03944 | train |
v3 | Schema:
regions (alias: rgn)(value, status, date, name)
tasks(value, status, id, amount)
Task: Retrieve id from regions with salary above the AVG(amount) of tasks rows sharing the same status.
SQL: | SELECT id FROM regions AS rgn
WHERE salary > (
SELECT AVG(amount) FROM tasks AS tsk
WHERE tsk.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03945 | train |
v3 | Schema:
shipments (alias: shp)(amount, id, code, value)
products(value, name, salary, date)
Task: Find amount from shipments where value exceeds the total salary from products for the same code.
SQL: | SELECT amount FROM shipments AS shp
WHERE value > (
SELECT SUM(salary) FROM products AS prod
WHERE prod.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03946 | train |
v3 | Schema:
invoices (alias: inv)(code, value, status, salary)
orders(amount, value, status, type)
Task: Find name from invoices where amount exceeds the total salary from orders for the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03947 | train |
v1 | Schema:
customers (alias: cust)(status, level, salary, code)
sales(code, id, amount, level)
Task: Retrieve id from customers whose level is found in sales rows where level matches the outer record.
SQL: | SELECT id FROM customers AS cust
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03948 | train |
v2 | Schema:
departments (alias: dept)(status, level, type, salary)
sales(name, id, salary, amount)
Task: Find name from departments where a matching record exists in sales with the same type.
SQL: | SELECT name FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03949 | train |
v3 | Schema:
products (alias: prod)(salary, id, name, type)
sales(level, type, date, status)
Task: Find salary from products where salary exceeds the total amount from sales for the same status.
SQL: | SELECT salary FROM products AS prod
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.status = prod.status
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03950 | train |
v2 | Schema:
accounts (alias: acct)(salary, id, value, code)
projects(value, salary, type, date)
Task: Find id from accounts where a matching record exists in projects with the same code.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03951 | train |
v1 | Schema:
requests (alias: ordr)(code, status, id, name)
categories(id, date, type, name)
Task: Select name from requests where code exists in categories for the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE code IN (
SELECT code FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03952 | train |
v1 | Schema:
invoices (alias: inv)(date, salary, level, type)
transactions(level, id, type, amount)
Task: Find name from invoices where id appears in transactions entries with matching level.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03953 | train |
v2 | Schema:
branches (alias: brc)(code, type, amount, name)
departments(salary, value, id, type)
Task: Find amount from branches where a matching record exists in departments with the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "departments",
"outer_alias": "brc",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_03954 | train |
v1 | Schema:
departments (alias: dept)(amount, code, level, status)
shipments(type, value, level, salary)
Task: Select amount from departments where code exists in shipments for the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "shipments",
"outer_alias": "dept",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03955 | train |
v3 | Schema:
employees (alias: emp)(value, amount, level, name)
schedules(amount, code, level, status)
Task: Find id from employees where salary exceeds the count of amount from schedules for the same id.
SQL: | SELECT id FROM employees AS emp
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "emp",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03956 | train |
v1 | Schema:
items (alias: lne)(name, value, code, type)
schedules(date, id, type, name)
Task: Select name from items where type exists in schedules for the same code.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = lne.code
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "lne",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03957 | train |
v2 | Schema:
orders (alias: ord)(code, status, amount, salary)
departments(level, amount, code, date)
Task: Find name from orders where a matching record exists in departments with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03958 | train |
v1 | Schema:
tasks (alias: tsk)(level, name, value, salary)
branches(code, salary, status, amount)
Task: Find amount from tasks where status appears in branches entries with matching level.
SQL: | SELECT amount FROM tasks AS tsk
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03959 | train |
v1 | Schema:
schedules (alias: schd)(value, date, amount, status)
branches(type, salary, value, id)
Task: Find amount from schedules where type appears in branches entries with matching code.
SQL: | SELECT amount FROM schedules AS schd
WHERE type IN (
SELECT type FROM branches AS brc
WHERE brc.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03960 | train |
v3 | Schema:
staff (alias: empl)(name, type, status, id)
products(id, name, type, code)
Task: Retrieve id from staff with salary above the MAX(value) of products rows sharing the same code.
SQL: | SELECT id FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03961 | train |
v1 | Schema:
transactions (alias: txn)(code, name, amount, date)
requests(level, type, code, salary)
Task: Find id from transactions where id appears in requests entries with matching level.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03962 | train |
v1 | Schema:
invoices (alias: inv)(name, date, type, salary)
managers(value, level, amount, salary)
Task: Select id from invoices where id exists in managers for the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "managers",
"outer_alias": "inv",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03963 | train |
v1 | Schema:
orders (alias: ord)(date, value, amount, status)
tasks(type, amount, status, id)
Task: Retrieve name from orders whose level is found in tasks rows where code matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03964 | train |
v3 | Schema:
shipments (alias: shp)(type, id, name, level)
managers(id, salary, status, name)
Task: Find code from shipments where salary exceeds the total value from managers for the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03965 | train |
v2 | Schema:
staff (alias: empl)(code, name, id, level)
schedules(name, amount, type, salary)
Task: Retrieve salary from staff that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "schedules",
"outer_alias": "empl",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03966 | train |
v1 | Schema:
managers (alias: mgr)(type, name, salary, id)
invoices(status, name, date, level)
Task: Select name from managers where id exists in invoices for the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03967 | train |
v1 | Schema:
items (alias: lne)(code, name, status, salary)
requests(code, status, name, amount)
Task: Retrieve name from items whose type is found in requests rows where level matches the outer record.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03968 | train |
v2 | Schema:
projects (alias: prj)(code, salary, status, value)
staff(amount, code, value, level)
Task: Find salary from projects where a matching record exists in staff with the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03969 | train |
v3 | Schema:
requests (alias: ordr)(name, salary, amount, date)
tasks(name, salary, status, amount)
Task: Find salary from requests where amount exceeds the total salary from tasks for the same id.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT SUM(salary) FROM tasks AS tsk
WHERE tsk.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03970 | train |
v3 | Schema:
orders (alias: ord)(status, value, level, code)
tasks(date, code, level, name)
Task: Find id from orders where salary exceeds the count of amount from tasks for the same type.
SQL: | SELECT id FROM orders AS ord
WHERE salary > (
SELECT COUNT(amount) FROM tasks AS tsk
WHERE tsk.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03971 | train |
v1 | Schema:
regions (alias: rgn)(salary, type, amount, date)
tasks(date, name, type, level)
Task: Select value from regions where code exists in tasks for the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_03972 | train |
v3 | Schema:
departments (alias: dept)(level, status, name, amount)
items(salary, date, level, name)
Task: Retrieve name from departments with salary above the MAX(value) of items rows sharing the same code.
SQL: | SELECT name FROM departments AS dept
WHERE salary > (
SELECT MAX(value) FROM items AS lne
WHERE lne.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "items",
"outer_alias": "dept",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03973 | train |
v3 | Schema:
schedules (alias: schd)(name, id, amount, code)
categories(code, name, level, status)
Task: Retrieve id from schedules with amount above the AVG(salary) of categories rows sharing the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03974 | train |
v3 | Schema:
projects (alias: prj)(status, salary, value, amount)
sales(date, level, code, name)
Task: Retrieve value from projects with amount above the COUNT(salary) of sales rows sharing the same code.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03975 | train |
v2 | Schema:
shipments (alias: shp)(amount, value, code, salary)
invoices(name, amount, status, type)
Task: Find id from shipments where a matching record exists in invoices with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03976 | train |
v2 | Schema:
staff (alias: empl)(amount, salary, name, value)
orders(code, value, date, level)
Task: Retrieve salary from staff that have at least one corresponding entry in orders sharing the same type.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_03977 | train |
v3 | Schema:
sales (alias: sale)(level, code, amount, name)
categories(value, salary, code, name)
Task: Find salary from sales where amount exceeds the total value from categories for the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "sale",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03978 | train |
v1 | Schema:
invoices (alias: inv)(name, id, type, salary)
customers(level, name, amount, code)
Task: Find code from invoices where type appears in customers entries with matching code.
SQL: | SELECT code FROM invoices AS inv
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03979 | train |
v3 | Schema:
projects (alias: prj)(status, name, type, date)
departments(name, type, level, date)
Task: Retrieve amount from projects with value above the AVG(salary) of departments rows sharing the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE value > (
SELECT AVG(salary) FROM departments AS dept
WHERE dept.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03980 | train |
v3 | Schema:
requests (alias: ordr)(level, id, code, value)
invoices(date, code, salary, level)
Task: Retrieve code from requests with amount above the MAX(value) of invoices rows sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03981 | train |
v3 | Schema:
shipments (alias: shp)(id, amount, type, level)
sales(amount, salary, date, id)
Task: Retrieve value from shipments with salary above the SUM(salary) of sales rows sharing the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03982 | train |
v1 | Schema:
transactions (alias: txn)(value, name, status, code)
regions(value, id, level, amount)
Task: Retrieve code from transactions whose code is found in regions rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03983 | train |
v2 | Schema:
products (alias: prod)(code, amount, name, salary)
accounts(date, name, status, salary)
Task: Find id from products where a matching record exists in accounts with the same code.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.code = prod.code
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03984 | train |
v1 | Schema:
departments (alias: dept)(type, code, salary, level)
branches(id, code, name, date)
Task: Select name from departments where id exists in branches for the same status.
SQL: | SELECT name FROM departments AS dept
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03985 | train |
v3 | Schema:
departments (alias: dept)(type, salary, id, amount)
transactions(level, value, date, code)
Task: Retrieve name from departments with value above the COUNT(value) of transactions rows sharing the same status.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT COUNT(value) FROM transactions AS txn
WHERE txn.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03986 | train |
v2 | Schema:
projects (alias: prj)(salary, name, level, code)
departments(code, id, status, type)
Task: Retrieve salary from projects that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT salary FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03987 | train |
v3 | Schema:
requests (alias: ordr)(level, salary, amount, value)
departments(id, code, type, level)
Task: Find salary from requests where amount exceeds the maximum salary from departments for the same status.
SQL: | SELECT salary FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_03988 | train |
v2 | Schema:
managers (alias: mgr)(id, code, value, type)
products(amount, type, value, salary)
Task: Retrieve salary from managers that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03989 | train |
v1 | Schema:
schedules (alias: schd)(code, value, amount, level)
projects(amount, date, salary, code)
Task: Select code from schedules where code exists in projects for the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE code IN (
SELECT code FROM projects AS prj
WHERE prj.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03990 | train |
v2 | Schema:
tasks (alias: tsk)(type, level, value, name)
regions(status, level, value, type)
Task: Retrieve amount from tasks that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03991 | train |
v3 | Schema:
shipments (alias: shp)(type, name, value, salary)
departments(value, level, type, code)
Task: Retrieve value from shipments with amount above the MAX(amount) of departments rows sharing the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE amount > (
SELECT MAX(amount) FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03992 | train |
v1 | Schema:
projects (alias: prj)(status, id, level, name)
accounts(status, date, code, level)
Task: Select name from projects where id exists in accounts for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_03993 | train |
v1 | Schema:
shipments (alias: shp)(name, value, code, type)
managers(type, date, name, id)
Task: Select value from shipments where id exists in managers for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_03994 | train |
v1 | Schema:
departments (alias: dept)(id, type, level, value)
orders(date, status, level, amount)
Task: Find id from departments where status appears in orders entries with matching code.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03995 | train |
v2 | Schema:
items (alias: lne)(status, name, salary, type)
branches(salary, amount, value, date)
Task: Retrieve id from items that have at least one corresponding entry in branches sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.status = lne.status
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_03996 | train |
v1 | Schema:
sales (alias: sale)(name, code, status, id)
orders(type, level, id, salary)
Task: Select value from sales where status exists in orders for the same type.
SQL: | SELECT value FROM sales AS sale
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_03997 | train |
v2 | Schema:
schedules (alias: schd)(type, status, salary, value)
projects(date, level, value, code)
Task: Find salary from schedules where a matching record exists in projects with the same status.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_03998 | train |
v2 | Schema:
tasks (alias: tsk)(salary, status, code, type)
customers(name, amount, level, salary)
Task: Find code from tasks where a matching record exists in customers with the same level.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_03999 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.