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:
requests (alias: ordr)(date, value, level, amount)
employees(amount, id, status, code)
Task: Retrieve value from requests with amount above the COUNT(salary) of employees rows sharing the same code.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT COUNT(salary) FROM employees AS emp
WHERE emp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08000 | train |
v1 | Schema:
transactions (alias: txn)(value, id, name, type)
products(id, code, level, salary)
Task: Retrieve code from transactions whose code is found in products rows where status matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08001 | train |
v1 | Schema:
requests (alias: ordr)(type, code, date, value)
categories(type, level, salary, code)
Task: Find code from requests where status appears in categories entries with matching level.
SQL: | SELECT code FROM requests AS ordr
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "categories",
"outer_alias": "ordr",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08002 | train |
v2 | Schema:
schedules (alias: schd)(type, date, amount, value)
managers(status, amount, salary, level)
Task: Retrieve value from schedules that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "schd",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08003 | train |
v2 | Schema:
requests (alias: ordr)(salary, value, name, level)
products(salary, status, value, level)
Task: Retrieve code from requests that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "products",
"outer_alias": "ordr",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08004 | train |
v1 | Schema:
shipments (alias: shp)(code, id, level, salary)
transactions(type, id, code, date)
Task: Retrieve value from shipments whose status is found in transactions rows where type matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE status IN (
SELECT status FROM transactions AS txn
WHERE txn.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08005 | train |
v1 | Schema:
staff (alias: empl)(salary, id, code, level)
branches(name, code, level, amount)
Task: Retrieve salary from staff whose status is found in branches rows where type matches the outer record.
SQL: | SELECT salary FROM staff AS empl
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08006 | train |
v3 | Schema:
branches (alias: brc)(value, level, id, name)
regions(status, id, code, name)
Task: Retrieve amount from branches with value above the SUM(amount) of regions rows sharing the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08007 | train |
v3 | Schema:
schedules (alias: schd)(value, id, amount, level)
customers(name, level, salary, date)
Task: Retrieve name from schedules with salary above the COUNT(salary) of customers rows sharing the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE salary > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "customers",
"outer_alias": "schd",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08008 | train |
v3 | Schema:
customers (alias: cust)(value, status, id, date)
sales(level, name, status, date)
Task: Find salary from customers where salary exceeds the total salary from sales for the same type.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08009 | train |
v2 | Schema:
items (alias: lne)(id, name, level, date)
categories(level, type, id, amount)
Task: Find salary from items where a matching record exists in categories with the same status.
SQL: | SELECT salary FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08010 | train |
v1 | Schema:
invoices (alias: inv)(level, id, type, code)
categories(amount, code, level, date)
Task: Retrieve id from invoices whose id is found in categories rows where id matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08011 | train |
v2 | Schema:
requests (alias: ordr)(value, level, status, type)
orders(type, date, level, code)
Task: Find id from requests where a matching record exists in orders with the same level.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08012 | train |
v2 | Schema:
shipments (alias: shp)(code, date, type, name)
accounts(level, code, type, amount)
Task: Find value from shipments where a matching record exists in accounts with the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_08013 | train |
v2 | Schema:
projects (alias: prj)(date, id, status, type)
managers(code, id, amount, status)
Task: Retrieve amount from projects that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT amount FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08014 | train |
v1 | Schema:
products (alias: prod)(name, code, status, type)
customers(value, level, id, date)
Task: Find id from products where id appears in customers entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.code = prod.code
); | {
"outer_table": "products",
"inner_table": "customers",
"outer_alias": "prod",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08015 | train |
v2 | Schema:
orders (alias: ord)(id, value, name, type)
invoices(value, amount, id, type)
Task: Retrieve id from orders that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08016 | train |
v3 | Schema:
tasks (alias: tsk)(salary, id, type, level)
branches(salary, amount, name, code)
Task: Find code from tasks where amount exceeds the average amount from branches for the same type.
SQL: | SELECT code FROM tasks AS tsk
WHERE amount > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "tsk",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08017 | train |
v2 | Schema:
products (alias: prod)(status, date, amount, code)
regions(amount, salary, date, value)
Task: Find salary from products where a matching record exists in regions with the same level.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = prod.level
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08018 | train |
v2 | Schema:
sales (alias: sale)(status, salary, id, name)
shipments(amount, level, status, type)
Task: Retrieve value from sales that have at least one corresponding entry in shipments sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08019 | train |
v1 | Schema:
requests (alias: ordr)(code, value, date, id)
items(type, id, salary, amount)
Task: Select name from requests where type exists in items for the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08020 | train |
v1 | Schema:
managers (alias: mgr)(code, level, name, date)
invoices(level, type, code, value)
Task: Retrieve name from managers whose status is found in invoices rows where status matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08021 | train |
v1 | Schema:
customers (alias: cust)(id, value, level, date)
items(id, level, salary, type)
Task: Find id from customers where type appears in items entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "cust",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08022 | train |
v3 | Schema:
tasks (alias: tsk)(status, code, salary, id)
invoices(salary, name, code, type)
Task: Find id from tasks where value exceeds the count of amount from invoices for the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE value > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08023 | train |
v2 | Schema:
products (alias: prod)(name, id, level, value)
regions(salary, id, amount, date)
Task: Find name from products where a matching record exists in regions with the same type.
SQL: | SELECT name FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08024 | train |
v3 | Schema:
products (alias: prod)(level, date, name, salary)
accounts(level, type, status, value)
Task: Find code from products where amount exceeds the total amount from accounts for the same level.
SQL: | SELECT code FROM products AS prod
WHERE amount > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08025 | train |
v2 | Schema:
products (alias: prod)(salary, level, amount, code)
accounts(type, amount, name, level)
Task: Find name from products where a matching record exists in accounts with the same code.
SQL: | SELECT name 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": "name",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08026 | train |
v1 | Schema:
transactions (alias: txn)(amount, id, value, code)
regions(name, code, level, id)
Task: Retrieve code from transactions whose level is found in regions rows where id matches the outer record.
SQL: | SELECT code FROM transactions AS txn
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08027 | train |
v2 | Schema:
schedules (alias: schd)(id, name, value, code)
categories(status, name, type, value)
Task: Find id from schedules where a matching record exists in categories with the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08028 | train |
v2 | Schema:
categories (alias: catg)(amount, status, value, level)
requests(value, date, id, amount)
Task: Find id from categories where a matching record exists in requests with the same type.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "requests",
"outer_alias": "catg",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08029 | train |
v2 | Schema:
regions (alias: rgn)(type, level, value, code)
staff(status, level, value, salary)
Task: Retrieve id from regions that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08030 | train |
v2 | Schema:
projects (alias: prj)(value, amount, code, level)
items(status, salary, value, date)
Task: Find name from projects where a matching record exists in items with the same code.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08031 | train |
v2 | Schema:
orders (alias: ord)(name, id, level, salary)
projects(type, id, salary, date)
Task: Retrieve value from orders that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08032 | train |
v1 | Schema:
items (alias: lne)(type, value, salary, date)
projects(type, level, value, code)
Task: Find salary from items where type appears in projects entries with matching level.
SQL: | SELECT salary FROM items AS lne
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.level = lne.level
); | {
"outer_table": "items",
"inner_table": "projects",
"outer_alias": "lne",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08033 | train |
v1 | Schema:
projects (alias: prj)(value, id, level, name)
products(name, code, date, id)
Task: Find amount from projects where level appears in products entries with matching level.
SQL: | SELECT amount FROM projects AS prj
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08034 | train |
v2 | Schema:
items (alias: lne)(code, id, status, type)
transactions(name, value, id, amount)
Task: Retrieve id from items that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "transactions",
"outer_alias": "lne",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08035 | train |
v2 | Schema:
managers (alias: mgr)(amount, level, status, id)
categories(type, status, level, salary)
Task: Find code from managers where a matching record exists in categories with the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08036 | train |
v1 | Schema:
tasks (alias: tsk)(name, date, amount, code)
products(type, name, date, value)
Task: Find id from tasks where id appears in products entries with matching status.
SQL: | SELECT id FROM tasks AS tsk
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08037 | train |
v3 | Schema:
sales (alias: sale)(date, amount, name, code)
invoices(id, level, name, code)
Task: Find salary from sales where salary exceeds the count of amount from invoices for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE salary > (
SELECT COUNT(amount) FROM invoices AS inv
WHERE inv.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08038 | train |
v1 | Schema:
accounts (alias: acct)(code, level, id, value)
staff(code, type, id, value)
Task: Find code from accounts where status appears in staff entries with matching level.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM staff AS empl
WHERE empl.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08039 | train |
v3 | Schema:
employees (alias: emp)(salary, status, level, amount)
managers(salary, name, level, status)
Task: Retrieve code from employees with amount above the SUM(value) of managers rows sharing the same type.
SQL: | SELECT code FROM employees AS emp
WHERE amount > (
SELECT SUM(value) FROM managers AS mgr
WHERE mgr.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08040 | train |
v2 | Schema:
schedules (alias: schd)(code, level, type, status)
transactions(salary, type, amount, level)
Task: Find id from schedules where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08041 | train |
v1 | Schema:
branches (alias: brc)(amount, salary, value, name)
projects(status, type, date, id)
Task: Retrieve code from branches whose status is found in projects rows where type matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08042 | train |
v2 | Schema:
invoices (alias: inv)(value, level, id, code)
schedules(value, date, type, id)
Task: Retrieve id from invoices that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "schedules",
"outer_alias": "inv",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08043 | train |
v3 | Schema:
departments (alias: dept)(code, date, status, level)
managers(name, type, amount, value)
Task: Retrieve code from departments with amount above the MAX(salary) of managers rows sharing the same id.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "managers",
"outer_alias": "dept",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08044 | train |
v2 | Schema:
products (alias: prod)(salary, value, type, date)
regions(level, type, value, code)
Task: Find name from products where a matching record exists in regions with the same id.
SQL: | SELECT name 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": "name",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08045 | train |
v3 | Schema:
staff (alias: empl)(code, type, amount, value)
tasks(status, amount, level, name)
Task: Retrieve value from staff with amount above the COUNT(amount) of tasks rows sharing the same code.
SQL: | SELECT value FROM staff AS empl
WHERE amount > (
SELECT COUNT(amount) FROM tasks AS tsk
WHERE tsk.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08046 | train |
v2 | Schema:
projects (alias: prj)(id, name, date, salary)
orders(name, value, date, level)
Task: Retrieve id from projects that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT id FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08047 | train |
v1 | Schema:
transactions (alias: txn)(amount, id, date, type)
products(type, level, name, id)
Task: Find value from transactions where status appears in products entries with matching type.
SQL: | SELECT value FROM transactions AS txn
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08048 | train |
v3 | Schema:
items (alias: lne)(code, date, status, value)
shipments(name, type, level, status)
Task: Retrieve name from items with amount above the SUM(amount) of shipments rows sharing the same id.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_08049 | train |
v2 | Schema:
employees (alias: emp)(amount, status, level, code)
requests(salary, code, type, value)
Task: Find value from employees where a matching record exists in requests with the same status.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "requests",
"outer_alias": "emp",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08050 | train |
v2 | Schema:
managers (alias: mgr)(code, id, type, amount)
employees(value, level, id, name)
Task: Find code from managers where a matching record exists in employees with the same status.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08051 | train |
v3 | Schema:
staff (alias: empl)(salary, status, type, amount)
categories(date, status, name, code)
Task: Find code from staff where amount exceeds the maximum value from categories for the same code.
SQL: | SELECT code FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM categories AS catg
WHERE catg.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "empl",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08052 | train |
v1 | Schema:
schedules (alias: schd)(value, status, date, code)
transactions(salary, code, value, status)
Task: Select code from schedules where id exists in transactions for the same code.
SQL: | SELECT code FROM schedules AS schd
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08053 | train |
v2 | Schema:
regions (alias: rgn)(name, amount, date, id)
departments(name, salary, amount, value)
Task: Retrieve name from regions that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08054 | train |
v2 | Schema:
transactions (alias: txn)(level, status, name, value)
orders(value, date, salary, status)
Task: Retrieve code from transactions that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08055 | train |
v1 | Schema:
tasks (alias: tsk)(type, value, level, date)
regions(type, salary, code, level)
Task: Retrieve code from tasks whose status is found in regions rows where id matches the outer record.
SQL: | SELECT code FROM tasks AS tsk
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08056 | train |
v1 | Schema:
products (alias: prod)(type, value, level, date)
tasks(status, name, value, id)
Task: Find id from products where code appears in tasks entries with matching status.
SQL: | SELECT id FROM products AS prod
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = prod.status
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08057 | train |
v2 | Schema:
sales (alias: sale)(salary, level, amount, status)
tasks(name, salary, amount, level)
Task: Retrieve name from sales that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08058 | train |
v3 | Schema:
orders (alias: ord)(date, name, salary, level)
employees(amount, id, code, date)
Task: Find name from orders where amount exceeds the total value from employees for the same code.
SQL: | SELECT name FROM orders AS ord
WHERE amount > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08059 | train |
v1 | Schema:
branches (alias: brc)(type, date, name, value)
orders(level, salary, amount, type)
Task: Retrieve code from branches whose id is found in orders rows where id matches the outer record.
SQL: | SELECT code FROM branches AS brc
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08060 | train |
v1 | Schema:
invoices (alias: inv)(code, salary, level, status)
regions(date, status, code, level)
Task: Find amount from invoices where code appears in regions entries with matching level.
SQL: | SELECT amount FROM invoices AS inv
WHERE code IN (
SELECT code FROM regions AS rgn
WHERE rgn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08061 | train |
v1 | Schema:
accounts (alias: acct)(amount, id, code, level)
items(date, level, code, status)
Task: Find value from accounts where id appears in items entries with matching id.
SQL: | SELECT value FROM accounts AS acct
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08062 | train |
v1 | Schema:
tasks (alias: tsk)(type, salary, code, name)
orders(level, date, code, value)
Task: Select name from tasks where type exists in orders for the same type.
SQL: | SELECT name FROM tasks AS tsk
WHERE type IN (
SELECT type FROM orders AS ord
WHERE ord.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "orders",
"outer_alias": "tsk",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08063 | train |
v1 | Schema:
departments (alias: dept)(date, value, type, salary)
schedules(amount, salary, value, level)
Task: Retrieve code from departments whose code is found in schedules rows where status matches the outer record.
SQL: | SELECT code FROM departments AS dept
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08064 | train |
v1 | Schema:
departments (alias: dept)(amount, salary, type, value)
schedules(value, code, id, level)
Task: Select code from departments where level exists in schedules for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08065 | train |
v2 | Schema:
transactions (alias: txn)(status, name, id, level)
projects(value, code, salary, status)
Task: Retrieve value from transactions that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08066 | train |
v3 | Schema:
branches (alias: brc)(salary, level, name, date)
requests(name, amount, status, salary)
Task: Find name from branches where value exceeds the maximum value from requests for the same code.
SQL: | SELECT name FROM branches AS brc
WHERE value > (
SELECT MAX(value) FROM requests AS ordr
WHERE ordr.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_08067 | train |
v2 | Schema:
invoices (alias: inv)(type, status, value, salary)
categories(name, value, amount, salary)
Task: Find amount from invoices where a matching record exists in categories with the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08068 | train |
v1 | Schema:
employees (alias: emp)(salary, name, type, id)
categories(salary, name, code, value)
Task: Find amount from employees where id appears in categories entries with matching id.
SQL: | SELECT amount FROM employees AS emp
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08069 | train |
v1 | Schema:
regions (alias: rgn)(value, name, amount, code)
schedules(status, value, amount, code)
Task: Select value from regions where code exists in schedules for the same status.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "rgn",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08070 | train |
v2 | Schema:
employees (alias: emp)(id, code, date, amount)
managers(level, value, name, salary)
Task: Find name from employees where a matching record exists in managers with the same id.
SQL: | SELECT name FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08071 | train |
v3 | Schema:
customers (alias: cust)(value, amount, code, type)
requests(status, code, amount, date)
Task: Find salary from customers where salary exceeds the count of salary from requests for the same id.
SQL: | SELECT salary FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08072 | train |
v3 | Schema:
staff (alias: empl)(salary, amount, level, code)
shipments(value, level, status, id)
Task: Find salary from staff where amount exceeds the count of value from shipments for the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM shipments AS shp
WHERE shp.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08073 | train |
v3 | Schema:
employees (alias: emp)(date, name, value, code)
shipments(status, type, name, value)
Task: Retrieve salary from employees with salary above the SUM(amount) of shipments rows sharing the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE salary > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08074 | train |
v3 | Schema:
products (alias: prod)(amount, code, name, date)
invoices(status, code, amount, id)
Task: Find value from products where amount exceeds the minimum value from invoices for the same level.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT MIN(value) FROM invoices AS inv
WHERE inv.level = prod.level
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08075 | train |
v3 | Schema:
invoices (alias: inv)(value, code, type, salary)
staff(amount, code, level, id)
Task: Find code from invoices where amount exceeds the total value from staff for the same type.
SQL: | SELECT code FROM invoices AS inv
WHERE amount > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08076 | train |
v3 | Schema:
accounts (alias: acct)(code, type, date, salary)
staff(value, amount, code, level)
Task: Retrieve name from accounts with value above the MIN(salary) of staff rows sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT MIN(salary) FROM staff AS empl
WHERE empl.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "acct",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08077 | train |
v2 | Schema:
requests (alias: ordr)(type, date, value, status)
regions(code, amount, id, date)
Task: Retrieve id from requests that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08078 | train |
v3 | Schema:
tasks (alias: tsk)(amount, type, level, name)
items(id, salary, level, status)
Task: Retrieve name from tasks with salary above the SUM(value) of items rows sharing the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE salary > (
SELECT SUM(value) FROM items AS lne
WHERE lne.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "tsk",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08079 | train |
v1 | Schema:
regions (alias: rgn)(date, name, type, code)
items(name, code, type, date)
Task: Find code from regions where level appears in items entries with matching type.
SQL: | SELECT code FROM regions AS rgn
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08080 | train |
v2 | Schema:
tasks (alias: tsk)(amount, id, value, name)
staff(amount, id, name, value)
Task: Find value from tasks where a matching record exists in staff with the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_08081 | train |
v3 | Schema:
sales (alias: sale)(id, amount, name, salary)
projects(value, id, code, status)
Task: Find salary from sales where value exceeds the count of value from projects for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE value > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "sale",
"inner_alias": "prj",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08082 | train |
v1 | Schema:
projects (alias: prj)(status, date, amount, level)
sales(date, value, name, type)
Task: Find amount from projects where id appears in sales entries with matching code.
SQL: | SELECT amount FROM projects AS prj
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "sales",
"outer_alias": "prj",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_08083 | train |
v3 | Schema:
transactions (alias: txn)(type, level, value, code)
requests(level, value, date, id)
Task: Find value from transactions where value exceeds the count of value from requests for the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE value > (
SELECT COUNT(value) FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08084 | train |
v3 | Schema:
products (alias: prod)(date, name, salary, value)
requests(amount, name, status, type)
Task: Find amount from products where salary exceeds the count of salary from requests for the same level.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.level = prod.level
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08085 | train |
v1 | Schema:
regions (alias: rgn)(amount, status, date, salary)
sales(value, name, salary, level)
Task: Select id from regions where id exists in sales for the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE id IN (
SELECT id FROM sales AS sale
WHERE sale.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08086 | train |
v1 | Schema:
schedules (alias: schd)(id, date, level, value)
shipments(amount, level, id, code)
Task: Find name from schedules where status appears in shipments entries with matching code.
SQL: | SELECT name FROM schedules AS schd
WHERE status IN (
SELECT status FROM shipments AS shp
WHERE shp.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08087 | train |
v3 | Schema:
categories (alias: catg)(date, level, status, name)
staff(amount, status, code, date)
Task: Retrieve value from categories with salary above the MAX(amount) of staff rows sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08088 | train |
v3 | Schema:
regions (alias: rgn)(level, amount, value, salary)
transactions(code, type, status, name)
Task: Find id from regions where value exceeds the total salary from transactions for the same code.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT SUM(salary) FROM transactions AS txn
WHERE txn.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08089 | train |
v3 | Schema:
regions (alias: rgn)(status, amount, id, name)
customers(date, value, level, salary)
Task: Find id from regions where amount exceeds the minimum salary from customers for the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08090 | train |
v2 | Schema:
products (alias: prod)(status, type, value, code)
staff(value, status, name, date)
Task: Find value from products where a matching record exists in staff with the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = prod.code
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08091 | train |
v2 | Schema:
regions (alias: rgn)(salary, value, status, code)
managers(name, date, id, type)
Task: Retrieve value from regions that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "managers",
"outer_alias": "rgn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08092 | train |
v2 | Schema:
accounts (alias: acct)(name, value, code, level)
shipments(status, name, date, id)
Task: Find amount from accounts where a matching record exists in shipments with the same status.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "shipments",
"outer_alias": "acct",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08093 | train |
v3 | Schema:
schedules (alias: schd)(value, name, id, status)
categories(name, id, amount, salary)
Task: Find id from schedules where amount exceeds the minimum value from categories for the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT MIN(value) FROM categories AS catg
WHERE catg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_08094 | train |
v3 | Schema:
regions (alias: rgn)(type, level, id, amount)
customers(value, status, id, amount)
Task: Retrieve amount from regions with salary above the MAX(amount) of customers rows sharing the same type.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_08095 | train |
v1 | Schema:
accounts (alias: acct)(level, id, value, name)
schedules(date, value, name, code)
Task: Select code from accounts where type exists in schedules for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08096 | train |
v1 | Schema:
staff (alias: empl)(type, code, id, level)
branches(amount, salary, value, code)
Task: Find id from staff where id appears in branches entries with matching type.
SQL: | SELECT id FROM staff AS empl
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "branches",
"outer_alias": "empl",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_08097 | train |
v3 | Schema:
requests (alias: ordr)(id, type, value, level)
schedules(date, status, code, type)
Task: Find amount from requests where salary exceeds the total value from schedules for the same status.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_08098 | train |
v2 | Schema:
transactions (alias: txn)(value, id, code, name)
invoices(amount, date, level, value)
Task: Find amount from transactions where a matching record exists in invoices with the same code.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "txn",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_08099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.