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 |
|---|---|---|---|---|---|---|
v1 | Schema:
orders (alias: ord)(value, salary, id, date)
schedules(type, name, code, value)
Task: Select name from orders where type exists in schedules for the same type.
SQL: | SELECT name FROM orders AS ord
WHERE type IN (
SELECT type FROM schedules AS schd
WHERE schd.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02300 | train |
v3 | Schema:
branches (alias: brc)(value, name, date, type)
invoices(amount, type, id, name)
Task: Find id from branches where salary exceeds the total amount from invoices for the same code.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT SUM(amount) FROM invoices AS inv
WHERE inv.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02301 | train |
v3 | Schema:
categories (alias: catg)(amount, code, salary, name)
products(value, type, amount, status)
Task: Find amount from categories where amount exceeds the maximum value from products for the same code.
SQL: | SELECT amount FROM categories AS catg
WHERE amount > (
SELECT MAX(value) FROM products AS prod
WHERE prod.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02302 | train |
v2 | Schema:
regions (alias: rgn)(salary, date, name, code)
staff(salary, status, name, id)
Task: Find name from regions where a matching record exists in staff with the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02303 | train |
v2 | Schema:
invoices (alias: inv)(value, salary, type, name)
shipments(id, amount, date, salary)
Task: Find amount from invoices where a matching record exists in shipments with the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02304 | train |
v2 | Schema:
transactions (alias: txn)(code, amount, id, value)
categories(salary, status, date, level)
Task: Retrieve salary from transactions that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "categories",
"outer_alias": "txn",
"inner_alias": "catg",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02305 | train |
v1 | Schema:
branches (alias: brc)(amount, status, id, code)
shipments(name, type, level, id)
Task: Select value from branches where code exists in shipments for the same type.
SQL: | SELECT value FROM branches AS brc
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "shipments",
"outer_alias": "brc",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02306 | train |
v3 | Schema:
departments (alias: dept)(id, status, salary, code)
regions(code, value, id, date)
Task: Find value from departments where amount exceeds the total salary from regions for the same level.
SQL: | SELECT value FROM departments AS dept
WHERE amount > (
SELECT SUM(salary) FROM regions AS rgn
WHERE rgn.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02307 | train |
v2 | Schema:
accounts (alias: acct)(level, code, amount, status)
branches(salary, type, code, date)
Task: Retrieve amount from accounts that have at least one corresponding entry in branches sharing the same type.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02308 | train |
v3 | Schema:
employees (alias: emp)(code, level, name, type)
staff(date, type, value, salary)
Task: Retrieve value from employees with salary above the MIN(amount) of staff rows sharing the same type.
SQL: | SELECT value FROM employees AS emp
WHERE salary > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02309 | train |
v1 | Schema:
transactions (alias: txn)(amount, salary, id, type)
regions(level, type, salary, status)
Task: Find name from transactions where type appears in regions entries with matching level.
SQL: | SELECT name FROM transactions AS txn
WHERE type IN (
SELECT type FROM regions AS rgn
WHERE rgn.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02310 | train |
v3 | Schema:
products (alias: prod)(date, id, type, code)
tasks(level, value, amount, code)
Task: Find salary from products where amount exceeds the count of salary from tasks for the same id.
SQL: | SELECT salary FROM products AS prod
WHERE amount > (
SELECT COUNT(salary) FROM tasks AS tsk
WHERE tsk.id = prod.id
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02311 | train |
v1 | Schema:
regions (alias: rgn)(amount, id, date, status)
products(name, id, value, type)
Task: Retrieve salary from regions whose id is found in products rows where level matches the outer record.
SQL: | SELECT salary FROM regions AS rgn
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "rgn",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02312 | train |
v3 | Schema:
products (alias: prod)(id, salary, type, value)
tasks(code, level, name, type)
Task: Retrieve amount from products with amount above the MIN(salary) of tasks rows sharing the same type.
SQL: | SELECT amount FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.type = prod.type
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02313 | train |
v3 | Schema:
categories (alias: catg)(name, status, value, amount)
sales(code, id, salary, value)
Task: Retrieve value from categories with value above the COUNT(salary) of sales rows sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02314 | train |
v3 | Schema:
staff (alias: empl)(value, type, name, level)
managers(name, type, level, value)
Task: Retrieve amount from staff with amount above the AVG(value) of managers rows sharing the same id.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "empl",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02315 | train |
v3 | Schema:
departments (alias: dept)(amount, type, code, status)
branches(id, type, salary, status)
Task: Retrieve amount from departments with salary above the AVG(value) of branches rows sharing the same id.
SQL: | SELECT amount FROM departments AS dept
WHERE salary > (
SELECT AVG(value) FROM branches AS brc
WHERE brc.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02316 | train |
v2 | Schema:
tasks (alias: tsk)(level, status, date, salary)
accounts(salary, date, status, level)
Task: Find value from tasks where a matching record exists in accounts with the same id.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "accounts",
"outer_alias": "tsk",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02317 | train |
v1 | Schema:
customers (alias: cust)(status, level, name, type)
invoices(level, id, name, code)
Task: Find amount from customers where id appears in invoices entries with matching id.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02318 | train |
v3 | Schema:
shipments (alias: shp)(level, status, id, name)
orders(type, salary, id, code)
Task: Find name from shipments where salary exceeds the count of salary from orders for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE salary > (
SELECT COUNT(salary) FROM orders AS ord
WHERE ord.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02319 | train |
v1 | Schema:
products (alias: prod)(amount, type, name, code)
shipments(status, value, id, code)
Task: Find value from products where code appears in shipments entries with matching code.
SQL: | SELECT value FROM products AS prod
WHERE code IN (
SELECT code FROM shipments AS shp
WHERE shp.code = prod.code
); | {
"outer_table": "products",
"inner_table": "shipments",
"outer_alias": "prod",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02320 | train |
v1 | Schema:
items (alias: lne)(salary, status, value, type)
categories(name, value, status, level)
Task: Find name from items where type appears in categories entries with matching status.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02321 | train |
v2 | Schema:
items (alias: lne)(value, amount, status, type)
departments(amount, type, code, name)
Task: Retrieve value from items that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = lne.status
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02322 | train |
v3 | Schema:
requests (alias: ordr)(date, salary, id, code)
departments(name, date, status, salary)
Task: Retrieve name from requests with amount above the SUM(amount) of departments rows sharing the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT SUM(amount) FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02323 | train |
v2 | Schema:
sales (alias: sale)(salary, name, amount, status)
transactions(code, level, amount, date)
Task: Find name from sales where a matching record exists in transactions with the same level.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02324 | train |
v1 | Schema:
regions (alias: rgn)(salary, code, amount, level)
customers(amount, salary, date, status)
Task: Find name from regions where level appears in customers entries with matching level.
SQL: | SELECT name FROM regions AS rgn
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02325 | train |
v3 | Schema:
schedules (alias: schd)(value, id, date, amount)
regions(amount, value, date, name)
Task: Retrieve id from schedules with amount above the MIN(salary) of regions rows sharing the same type.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02326 | train |
v3 | Schema:
invoices (alias: inv)(type, value, level, status)
customers(salary, type, date, status)
Task: Retrieve id from invoices with value above the AVG(amount) of customers rows sharing the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE value > (
SELECT AVG(amount) FROM customers AS cust
WHERE cust.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "customers",
"outer_alias": "inv",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02327 | train |
v3 | Schema:
managers (alias: mgr)(date, code, level, status)
departments(salary, name, level, type)
Task: Retrieve amount from managers with amount above the AVG(value) of departments rows sharing the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02328 | train |
v1 | Schema:
tasks (alias: tsk)(type, code, date, status)
invoices(level, date, status, id)
Task: Retrieve amount from tasks whose id is found in invoices rows where id matches the outer record.
SQL: | SELECT amount FROM tasks AS tsk
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02329 | train |
v2 | Schema:
accounts (alias: acct)(id, value, name, level)
tasks(name, value, salary, type)
Task: Retrieve name from accounts that have at least one corresponding entry in tasks sharing the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02330 | train |
v3 | Schema:
projects (alias: prj)(value, type, code, name)
branches(id, status, name, code)
Task: Retrieve amount from projects with amount above the SUM(amount) of branches rows sharing the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE amount > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02331 | train |
v3 | Schema:
departments (alias: dept)(value, status, type, date)
staff(status, level, id, salary)
Task: Find code from departments where value exceeds the total value from staff for the same level.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM staff AS empl
WHERE empl.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "staff",
"outer_alias": "dept",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02332 | train |
v1 | Schema:
orders (alias: ord)(amount, date, type, id)
customers(salary, level, status, name)
Task: Retrieve salary from orders whose status is found in customers rows where code matches the outer record.
SQL: | SELECT salary FROM orders AS ord
WHERE status IN (
SELECT status FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02333 | train |
v3 | Schema:
tasks (alias: tsk)(date, code, type, salary)
staff(status, level, date, name)
Task: Retrieve id from tasks with amount above the MAX(amount) of staff rows sharing the same id.
SQL: | SELECT id FROM tasks AS tsk
WHERE amount > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02334 | train |
v2 | Schema:
accounts (alias: acct)(amount, type, salary, code)
sales(type, status, code, date)
Task: Retrieve value from accounts that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT value FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02335 | train |
v1 | Schema:
accounts (alias: acct)(id, value, code, salary)
customers(salary, value, status, level)
Task: Select name from accounts where id exists in customers for the same type.
SQL: | SELECT name FROM accounts AS acct
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02336 | train |
v2 | Schema:
schedules (alias: schd)(date, code, status, salary)
transactions(name, salary, value, id)
Task: Find name from schedules where a matching record exists in transactions with the same type.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "transactions",
"outer_alias": "schd",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02337 | train |
v2 | Schema:
departments (alias: dept)(code, name, amount, type)
requests(name, amount, level, date)
Task: Retrieve value from departments that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT value FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02338 | train |
v1 | Schema:
branches (alias: brc)(value, code, name, status)
orders(date, type, code, name)
Task: Select salary from branches where code exists in orders for the same level.
SQL: | SELECT salary FROM branches AS brc
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_02339 | train |
v1 | Schema:
staff (alias: empl)(date, type, name, amount)
sales(status, code, date, id)
Task: Select name from staff where type exists in sales for the same id.
SQL: | SELECT name FROM staff AS empl
WHERE type IN (
SELECT type FROM sales AS sale
WHERE sale.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "sales",
"outer_alias": "empl",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02340 | train |
v3 | Schema:
managers (alias: mgr)(code, status, date, level)
sales(value, type, date, status)
Task: Retrieve salary from managers with value above the COUNT(salary) of sales rows sharing the same id.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT COUNT(salary) FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02341 | train |
v2 | Schema:
managers (alias: mgr)(date, level, amount, type)
sales(date, level, value, status)
Task: Retrieve code from managers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02342 | train |
v3 | Schema:
projects (alias: prj)(salary, id, code, level)
managers(id, value, salary, level)
Task: Retrieve value from projects with amount above the MAX(salary) of managers rows sharing the same id.
SQL: | SELECT value FROM projects AS prj
WHERE amount > (
SELECT MAX(salary) FROM managers AS mgr
WHERE mgr.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "managers",
"outer_alias": "prj",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02343 | train |
v2 | Schema:
managers (alias: mgr)(level, date, name, id)
tasks(amount, date, value, name)
Task: Find salary from managers where a matching record exists in tasks with the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02344 | train |
v1 | Schema:
shipments (alias: shp)(name, salary, amount, code)
staff(status, name, level, code)
Task: Retrieve id from shipments whose code is found in staff rows where level matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "shp",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02345 | train |
v2 | Schema:
invoices (alias: inv)(code, name, id, type)
items(type, date, status, id)
Task: Find salary from invoices where a matching record exists in items with the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02346 | train |
v2 | Schema:
projects (alias: prj)(status, date, code, value)
employees(code, date, name, value)
Task: Find value from projects where a matching record exists in employees with the same code.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02347 | train |
v3 | Schema:
categories (alias: catg)(level, value, status, date)
branches(id, code, level, amount)
Task: Find id from categories where salary exceeds the minimum value from branches for the same status.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "branches",
"outer_alias": "catg",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02348 | train |
v3 | Schema:
shipments (alias: shp)(amount, status, date, type)
customers(status, name, date, level)
Task: Retrieve amount from shipments with amount above the MAX(amount) of customers rows sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE amount > (
SELECT MAX(amount) FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02349 | train |
v1 | Schema:
employees (alias: emp)(value, date, type, id)
customers(type, salary, value, date)
Task: Select code from employees where level exists in customers for the same status.
SQL: | SELECT code FROM employees AS emp
WHERE level IN (
SELECT level FROM customers AS cust
WHERE cust.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02350 | train |
v3 | Schema:
transactions (alias: txn)(type, status, date, level)
sales(status, salary, name, type)
Task: Retrieve amount from transactions with salary above the SUM(salary) of sales rows sharing the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT SUM(salary) FROM sales AS sale
WHERE sale.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02351 | train |
v1 | Schema:
regions (alias: rgn)(status, salary, level, value)
staff(code, level, id, name)
Task: Find amount from regions where level appears in staff entries with matching level.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM staff AS empl
WHERE empl.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02352 | train |
v1 | Schema:
managers (alias: mgr)(value, id, type, amount)
orders(id, name, code, status)
Task: Find name from managers where id appears in orders entries with matching code.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02353 | train |
v3 | Schema:
transactions (alias: txn)(type, status, salary, code)
employees(type, level, amount, name)
Task: Retrieve name from transactions with value above the AVG(salary) of employees rows sharing the same code.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "employees",
"outer_alias": "txn",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02354 | train |
v3 | Schema:
schedules (alias: schd)(level, name, salary, status)
staff(level, amount, id, name)
Task: Retrieve amount from schedules with amount above the SUM(salary) of staff rows sharing the same level.
SQL: | SELECT amount FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) FROM staff AS empl
WHERE empl.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02355 | train |
v2 | Schema:
schedules (alias: schd)(type, code, value, status)
departments(amount, status, level, salary)
Task: Find amount from schedules where a matching record exists in departments with the same type.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "schd",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02356 | train |
v2 | Schema:
customers (alias: cust)(level, date, id, amount)
sales(value, amount, salary, name)
Task: Retrieve name from customers that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "sales",
"outer_alias": "cust",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02357 | train |
v3 | Schema:
customers (alias: cust)(code, salary, level, name)
sales(name, code, salary, level)
Task: Retrieve id from customers with salary above the COUNT(amount) of sales rows sharing the same level.
SQL: | SELECT id FROM customers AS cust
WHERE salary > (
SELECT COUNT(amount) 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": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02358 | train |
v1 | Schema:
transactions (alias: txn)(code, level, salary, value)
schedules(value, code, type, salary)
Task: Select id from transactions where id exists in schedules for the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02359 | train |
v2 | Schema:
transactions (alias: txn)(status, date, type, level)
managers(amount, value, code, salary)
Task: Retrieve id from transactions that have at least one corresponding entry in managers sharing the same status.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02360 | train |
v1 | Schema:
accounts (alias: acct)(name, type, code, level)
tasks(code, name, level, value)
Task: Retrieve id from accounts whose level is found in tasks rows where id matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02361 | train |
v2 | Schema:
customers (alias: cust)(code, level, date, status)
orders(status, salary, level, date)
Task: Find name from customers where a matching record exists in orders with the same status.
SQL: | SELECT name FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "orders",
"outer_alias": "cust",
"inner_alias": "ord",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02362 | train |
v3 | Schema:
departments (alias: dept)(id, value, date, code)
requests(name, value, code, type)
Task: Retrieve salary from departments with value above the MAX(amount) of requests rows sharing the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02363 | train |
v1 | Schema:
items (alias: lne)(code, amount, salary, date)
invoices(name, status, level, id)
Task: Select id from items where id exists in invoices for the same code.
SQL: | SELECT id FROM items AS lne
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02364 | train |
v3 | Schema:
customers (alias: cust)(level, code, type, salary)
products(code, level, date, type)
Task: Find value from customers where salary exceeds the average value from products for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE salary > (
SELECT AVG(value) FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02365 | train |
v2 | Schema:
departments (alias: dept)(type, status, amount, salary)
transactions(name, amount, level, date)
Task: Retrieve id from departments that have at least one corresponding entry in transactions sharing the same code.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02366 | train |
v1 | Schema:
regions (alias: rgn)(value, level, name, type)
invoices(code, status, level, salary)
Task: Select value from regions where type exists in invoices for the same id.
SQL: | SELECT value FROM regions AS rgn
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02367 | train |
v3 | Schema:
departments (alias: dept)(value, amount, code, level)
branches(id, code, salary, status)
Task: Retrieve id from departments with salary above the AVG(amount) of branches rows sharing the same id.
SQL: | SELECT id FROM departments AS dept
WHERE salary > (
SELECT AVG(amount) FROM branches AS brc
WHERE brc.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02368 | train |
v2 | Schema:
regions (alias: rgn)(amount, value, level, name)
transactions(salary, value, name, amount)
Task: Find amount from regions where a matching record exists in transactions with the same code.
SQL: | SELECT amount FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02369 | train |
v3 | Schema:
items (alias: lne)(level, value, name, salary)
customers(salary, value, amount, id)
Task: Find name from items where value exceeds the minimum amount from customers for the same id.
SQL: | SELECT name FROM items AS lne
WHERE value > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_02370 | train |
v1 | Schema:
accounts (alias: acct)(amount, name, value, salary)
items(name, id, value, code)
Task: Retrieve value from accounts whose status is found in items rows where level matches the outer record.
SQL: | SELECT value FROM accounts AS acct
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02371 | train |
v2 | Schema:
tasks (alias: tsk)(value, id, salary, status)
products(type, salary, level, date)
Task: Retrieve code from tasks that have at least one corresponding entry in products sharing the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02372 | train |
v3 | Schema:
orders (alias: ord)(code, level, amount, status)
schedules(name, level, code, id)
Task: Find salary from orders where amount exceeds the count of amount from schedules for the same status.
SQL: | SELECT salary FROM orders AS ord
WHERE amount > (
SELECT COUNT(amount) FROM schedules AS schd
WHERE schd.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02373 | train |
v3 | Schema:
tasks (alias: tsk)(name, level, salary, amount)
regions(status, salary, amount, level)
Task: Find salary from tasks where salary exceeds the count of value from regions for the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE salary > (
SELECT COUNT(value) FROM regions AS rgn
WHERE rgn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02374 | train |
v2 | Schema:
tasks (alias: tsk)(value, id, date, level)
invoices(level, date, amount, value)
Task: Find amount from tasks where a matching record exists in invoices with the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_02375 | train |
v1 | Schema:
sales (alias: sale)(value, amount, level, code)
employees(value, amount, date, type)
Task: Retrieve code from sales whose id is found in employees rows where level matches the outer record.
SQL: | SELECT code FROM sales AS sale
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02376 | train |
v1 | Schema:
accounts (alias: acct)(amount, date, salary, status)
branches(level, code, amount, value)
Task: Find salary from accounts where id appears in branches entries with matching code.
SQL: | SELECT salary FROM accounts AS acct
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "acct",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02377 | train |
v3 | Schema:
projects (alias: prj)(status, type, salary, name)
orders(level, type, value, status)
Task: Find name from projects where salary exceeds the average value from orders for the same id.
SQL: | SELECT name FROM projects AS prj
WHERE salary > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "orders",
"outer_alias": "prj",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_02378 | train |
v1 | Schema:
sales (alias: sale)(code, type, date, id)
employees(amount, type, name, id)
Task: Find value from sales where type appears in employees entries with matching status.
SQL: | SELECT value FROM sales AS sale
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02379 | train |
v2 | Schema:
staff (alias: empl)(status, date, amount, value)
orders(date, value, salary, name)
Task: Find value from staff where a matching record exists in orders with the same level.
SQL: | SELECT value FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "empl",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02380 | train |
v3 | Schema:
shipments (alias: shp)(level, name, amount, id)
managers(type, status, salary, date)
Task: Retrieve value from shipments with value above the SUM(salary) of managers rows sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02381 | train |
v2 | Schema:
regions (alias: rgn)(id, date, type, value)
branches(id, salary, level, status)
Task: Find value from regions where a matching record exists in branches with the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_02382 | train |
v2 | Schema:
requests (alias: ordr)(code, amount, type, value)
shipments(value, type, code, amount)
Task: Find code from requests where a matching record exists in shipments with the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "shipments",
"outer_alias": "ordr",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_02383 | train |
v3 | Schema:
schedules (alias: schd)(amount, salary, date, id)
orders(amount, type, level, status)
Task: Find salary from schedules where amount exceeds the total amount from orders for the same id.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_02384 | train |
v2 | Schema:
managers (alias: mgr)(amount, name, code, status)
staff(salary, amount, code, status)
Task: Find name from managers where a matching record exists in staff with the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02385 | train |
v1 | Schema:
staff (alias: empl)(type, salary, code, value)
requests(name, salary, id, date)
Task: Select code from staff where id exists in requests for the same level.
SQL: | SELECT code FROM staff AS empl
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_02386 | train |
v2 | Schema:
customers (alias: cust)(name, value, level, id)
transactions(status, salary, amount, code)
Task: Find id from customers where a matching record exists in transactions with the same level.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "transactions",
"outer_alias": "cust",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02387 | train |
v1 | Schema:
sales (alias: sale)(status, id, name, value)
managers(date, id, value, name)
Task: Retrieve amount from sales whose code is found in managers rows where type matches the outer record.
SQL: | SELECT amount FROM sales AS sale
WHERE code IN (
SELECT code FROM managers AS mgr
WHERE mgr.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "managers",
"outer_alias": "sale",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02388 | train |
v2 | Schema:
accounts (alias: acct)(salary, status, type, level)
items(date, level, type, value)
Task: Retrieve id from accounts that have at least one corresponding entry in items sharing the same status.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02389 | train |
v2 | Schema:
shipments (alias: shp)(name, salary, id, date)
customers(status, amount, date, salary)
Task: Find code from shipments where a matching record exists in customers with the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02390 | train |
v3 | Schema:
transactions (alias: txn)(code, salary, type, value)
orders(salary, status, type, value)
Task: Find salary from transactions where amount exceeds the average value from orders for the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE amount > (
SELECT AVG(value) FROM orders AS ord
WHERE ord.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02391 | train |
v2 | Schema:
shipments (alias: shp)(id, level, code, type)
branches(value, salary, date, id)
Task: Find code from shipments where a matching record exists in branches with the same type.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02392 | train |
v3 | Schema:
products (alias: prod)(salary, name, type, status)
projects(name, status, amount, type)
Task: Find amount from products where salary exceeds the total amount from projects for the same status.
SQL: | SELECT amount FROM products AS prod
WHERE salary > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.status = prod.status
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "amount",
"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_02393 | train |
v2 | Schema:
shipments (alias: shp)(id, name, amount, salary)
accounts(value, level, salary, name)
Task: Retrieve code from shipments that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "shp",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02394 | train |
v3 | Schema:
managers (alias: mgr)(salary, name, amount, status)
shipments(amount, salary, level, value)
Task: Find code from managers where amount exceeds the average amount from shipments for the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT AVG(amount) FROM shipments AS shp
WHERE shp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02395 | train |
v2 | Schema:
managers (alias: mgr)(value, salary, code, level)
sales(date, amount, status, value)
Task: Retrieve id from managers that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02396 | train |
v2 | Schema:
products (alias: prod)(status, level, salary, amount)
sales(amount, name, id, level)
Task: Retrieve code from products that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = prod.status
); | {
"outer_table": "products",
"inner_table": "sales",
"outer_alias": "prod",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02397 | train |
v1 | Schema:
shipments (alias: shp)(type, salary, status, date)
branches(level, status, date, name)
Task: Find value from shipments where id appears in branches entries with matching id.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_02398 | train |
v2 | Schema:
products (alias: prod)(id, amount, level, status)
branches(type, code, date, id)
Task: Retrieve value from products that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = prod.code
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "prod",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_02399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.