variant stringclasses 3
values | prompt stringlengths 163 234 | sql stringlengths 104 140 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
accounts (alias: jac)(code, salary, id, amount)
items(amount, id, date, type)
Task: Retrieve name from accounts with salary above the MAX(amount) of items rows sharing the same id.
SQL: | SELECT name FROM accounts AS jac
WHERE salary > (
SELECT MAX(amount) FROM items AS ikob
WHERE ikob.id = jac.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "jac",
"inner_alias": "ikob",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "jac.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00600 | train |
v3 | Schema:
projects (alias: uliv)(type, level, name, date)
items(date, amount, level, id)
Task: Find id from projects where value exceeds the total salary from items for the same id.
SQL: | SELECT id FROM projects AS uliv
WHERE value > (
SELECT SUM(salary) FROM items AS ikob
WHERE ikob.id = uliv.id
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "uliv",
"inner_alias": "ikob",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "uliv.id",
"token_group": "T2",
"fan_out": 65
} | T2 | cs9_fixed_v1_train_00601 | train |
v1 | Schema:
products (alias: nad)(id, date, amount, code)
orders(level, date, type, value)
Task: Select code from products where code exists in orders for the same level.
SQL: | SELECT code FROM products AS nad
WHERE code IN (
SELECT code FROM orders AS kab
WHERE kab.level = nad.level
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "nad",
"inner_alias": "kab",
"proj_col": "code",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "nad.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00602 | train |
v1 | Schema:
managers (alias: hac)(amount, salary, type, value)
products(name, type, date, amount)
Task: Retrieve name from managers whose code is found in products rows where status matches the outer record.
SQL: | SELECT name FROM managers AS hac
WHERE code IN (
SELECT code FROM products AS nad
WHERE nad.status = hac.status
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "hac",
"inner_alias": "nad",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "hac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00603 | train |
v1 | Schema:
requests (alias: ejof)(code, type, salary, value)
departments(code, status, id, amount)
Task: Select name from requests where type exists in departments for the same level.
SQL: | SELECT name FROM requests AS ejof
WHERE type IN (
SELECT type FROM departments AS dov
WHERE dov.level = ejof.level
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ejof",
"inner_alias": "dov",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "ejof.level",
"token_group": "T2",
"fan_out": 70
} | T2 | cs9_fixed_v1_train_00604 | train |
v3 | Schema:
accounts (alias: jac)(value, amount, type, code)
requests(type, level, name, status)
Task: Find salary from accounts where value exceeds the count of salary from requests for the same id.
SQL: | SELECT salary FROM accounts AS jac
WHERE value > (
SELECT COUNT(salary) FROM requests AS ejof
WHERE ejof.id = jac.id
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "jac",
"inner_alias": "ejof",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "jac.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00605 | train |
v2 | Schema:
requests (alias: ejof)(salary, value, date, level)
transactions(type, date, code, salary)
Task: Find value from requests where a matching record exists in transactions with the same type.
SQL: | SELECT value FROM requests AS ejof
WHERE EXISTS (
SELECT 1 FROM transactions AS gev
WHERE gev.type = ejof.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ejof",
"inner_alias": "gev",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ejof.type",
"token_group": "T2",
"fan_out": 70
} | T2 | cs9_fixed_v1_train_00606 | train |
v2 | Schema:
transactions (alias: gev)(type, date, salary, value)
departments(code, amount, value, id)
Task: Retrieve name from transactions that have at least one corresponding entry in departments sharing the same type.
SQL: | SELECT name FROM transactions AS gev
WHERE EXISTS (
SELECT 1 FROM departments AS dov
WHERE dov.type = gev.type
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "gev",
"inner_alias": "dov",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "gev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00607 | train |
v3 | Schema:
invoices (alias: fal)(salary, code, name, id)
accounts(status, date, id, amount)
Task: Find value from invoices where salary exceeds the average salary from accounts for the same status.
SQL: | SELECT value FROM invoices AS fal
WHERE salary > (
SELECT AVG(salary) FROM accounts AS jac
WHERE jac.status = fal.status
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "fal",
"inner_alias": "jac",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "fal.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00608 | train |
v1 | Schema:
products (alias: nad)(status, date, type, id)
items(amount, code, date, type)
Task: Select code from products where id exists in items for the same type.
SQL: | SELECT code FROM products AS nad
WHERE id IN (
SELECT id FROM items AS ikob
WHERE ikob.type = nad.type
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "nad",
"inner_alias": "ikob",
"proj_col": "code",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "nad.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00609 | train |
v1 | Schema:
sales (alias: cif)(date, id, amount, level)
projects(salary, value, amount, date)
Task: Find id from sales where level appears in projects entries with matching level.
SQL: | SELECT id FROM sales AS cif
WHERE level IN (
SELECT level FROM projects AS uliv
WHERE uliv.level = cif.level
); | {
"outer_table": "sales",
"inner_table": "projects",
"outer_alias": "cif",
"inner_alias": "uliv",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "cif.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00610 | train |
v1 | Schema:
tasks (alias: znob)(value, amount, code, type)
employees(code, level, name, id)
Task: Find salary from tasks where type appears in employees entries with matching code.
SQL: | SELECT salary FROM tasks AS znob
WHERE type IN (
SELECT type FROM employees AS bev
WHERE bev.code = znob.code
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "znob",
"inner_alias": "bev",
"proj_col": "salary",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "znob.code",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00611 | train |
v2 | Schema:
items (alias: ikob)(code, amount, value, salary)
branches(amount, code, id, status)
Task: Find salary from items where a matching record exists in branches with the same code.
SQL: | SELECT salary FROM items AS ikob
WHERE EXISTS (
SELECT 1 FROM branches AS agov
WHERE agov.code = ikob.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "ikob",
"inner_alias": "agov",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ikob.code",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00612 | train |
v1 | Schema:
transactions (alias: gev)(salary, date, level, code)
accounts(status, salary, id, level)
Task: Retrieve salary from transactions whose level is found in accounts rows where code matches the outer record.
SQL: | SELECT salary FROM transactions AS gev
WHERE level IN (
SELECT level FROM accounts AS jac
WHERE jac.code = gev.code
); | {
"outer_table": "transactions",
"inner_table": "accounts",
"outer_alias": "gev",
"inner_alias": "jac",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "gev.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00613 | train |
v2 | Schema:
schedules (alias: vmob)(value, status, id, salary)
regions(amount, type, status, id)
Task: Retrieve id from schedules that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT id FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM regions AS okiv
WHERE okiv.type = vmob.type
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "vmob",
"inner_alias": "okiv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "vmob.type",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00614 | train |
v1 | Schema:
orders (alias: kab)(level, name, date, type)
accounts(code, amount, id, value)
Task: Select id from orders where code exists in accounts for the same level.
SQL: | SELECT id FROM orders AS kab
WHERE code IN (
SELECT code FROM accounts AS jac
WHERE jac.level = kab.level
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "kab",
"inner_alias": "jac",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "kab.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00615 | train |
v1 | Schema:
projects (alias: uliv)(type, date, code, value)
departments(level, status, date, id)
Task: Find id from projects where level appears in departments entries with matching type.
SQL: | SELECT id FROM projects AS uliv
WHERE level IN (
SELECT level FROM departments AS dov
WHERE dov.type = uliv.type
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "uliv",
"inner_alias": "dov",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "uliv.type",
"token_group": "T2",
"fan_out": 65
} | T2 | cs9_fixed_v1_train_00616 | train |
v2 | Schema:
branches (alias: agov)(name, type, amount, level)
requests(salary, id, name, value)
Task: Find value from branches where a matching record exists in requests with the same level.
SQL: | SELECT value FROM branches AS agov
WHERE EXISTS (
SELECT 1 FROM requests AS ejof
WHERE ejof.level = agov.level
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "agov",
"inner_alias": "ejof",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "agov.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00617 | train |
v2 | Schema:
products (alias: nad)(amount, type, date, salary)
schedules(code, date, type, amount)
Task: Retrieve name from products that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT name FROM products AS nad
WHERE EXISTS (
SELECT 1 FROM schedules AS vmob
WHERE vmob.id = nad.id
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "nad",
"inner_alias": "vmob",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "nad.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00618 | train |
v3 | Schema:
schedules (alias: vmob)(type, code, salary, amount)
requests(code, value, date, id)
Task: Find name from schedules where amount exceeds the minimum amount from requests for the same code.
SQL: | SELECT name FROM schedules AS vmob
WHERE amount > (
SELECT MIN(amount) FROM requests AS ejof
WHERE ejof.code = vmob.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "vmob",
"inner_alias": "ejof",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "vmob.code",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00619 | train |
v1 | Schema:
branches (alias: agov)(type, date, code, level)
requests(name, code, id, status)
Task: Retrieve salary from branches whose code is found in requests rows where status matches the outer record.
SQL: | SELECT salary FROM branches AS agov
WHERE code IN (
SELECT code FROM requests AS ejof
WHERE ejof.status = agov.status
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "agov",
"inner_alias": "ejof",
"proj_col": "salary",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "agov.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00620 | train |
v3 | Schema:
customers (alias: lex)(status, name, amount, code)
projects(date, value, amount, salary)
Task: Retrieve code from customers with amount above the MIN(value) of projects rows sharing the same code.
SQL: | SELECT code FROM customers AS lex
WHERE amount > (
SELECT MIN(value) FROM projects AS uliv
WHERE uliv.code = lex.code
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "lex",
"inner_alias": "uliv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "lex.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00621 | train |
v2 | Schema:
staff (alias: xnob)(salary, code, name, id)
departments(salary, value, code, date)
Task: Retrieve name from staff that have at least one corresponding entry in departments sharing the same code.
SQL: | SELECT name FROM staff AS xnob
WHERE EXISTS (
SELECT 1 FROM departments AS dov
WHERE dov.code = xnob.code
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "xnob",
"inner_alias": "dov",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "xnob.code",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00622 | train |
v2 | Schema:
transactions (alias: gev)(value, level, status, date)
regions(amount, date, name, code)
Task: Retrieve salary from transactions that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT salary FROM transactions AS gev
WHERE EXISTS (
SELECT 1 FROM regions AS okiv
WHERE okiv.type = gev.type
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "gev",
"inner_alias": "okiv",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "gev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00623 | train |
v1 | Schema:
regions (alias: okiv)(level, code, type, date)
customers(status, amount, name, salary)
Task: Select name from regions where code exists in customers for the same status.
SQL: | SELECT name FROM regions AS okiv
WHERE code IN (
SELECT code FROM customers AS lex
WHERE lex.status = okiv.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "okiv",
"inner_alias": "lex",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "okiv.status",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00624 | train |
v3 | Schema:
products (alias: nad)(id, code, status, amount)
schedules(amount, id, value, code)
Task: Retrieve id from products with value above the AVG(value) of schedules rows sharing the same code.
SQL: | SELECT id FROM products AS nad
WHERE value > (
SELECT AVG(value) FROM schedules AS vmob
WHERE vmob.code = nad.code
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "nad",
"inner_alias": "vmob",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "nad.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00625 | train |
v3 | Schema:
sales (alias: cif)(status, amount, value, code)
accounts(status, type, level, amount)
Task: Retrieve salary from sales with amount above the COUNT(salary) of accounts rows sharing the same type.
SQL: | SELECT salary FROM sales AS cif
WHERE amount > (
SELECT COUNT(salary) FROM accounts AS jac
WHERE jac.type = cif.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "cif",
"inner_alias": "jac",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "cif.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00626 | train |
v3 | Schema:
branches (alias: agov)(value, date, type, code)
customers(code, amount, type, date)
Task: Find name from branches where salary exceeds the maximum amount from customers for the same code.
SQL: | SELECT name FROM branches AS agov
WHERE salary > (
SELECT MAX(amount) FROM customers AS lex
WHERE lex.code = agov.code
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "agov",
"inner_alias": "lex",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "agov.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00627 | train |
v1 | Schema:
orders (alias: kab)(status, date, salary, id)
managers(value, amount, id, type)
Task: Retrieve value from orders whose code is found in managers rows where status matches the outer record.
SQL: | SELECT value FROM orders AS kab
WHERE code IN (
SELECT code FROM managers AS hac
WHERE hac.status = kab.status
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "kab",
"inner_alias": "hac",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "kab.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00628 | train |
v2 | Schema:
branches (alias: agov)(salary, id, code, type)
items(id, status, amount, type)
Task: Find id from branches where a matching record exists in items with the same status.
SQL: | SELECT id FROM branches AS agov
WHERE EXISTS (
SELECT 1 FROM items AS ikob
WHERE ikob.status = agov.status
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "agov",
"inner_alias": "ikob",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "agov.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00629 | train |
v2 | Schema:
transactions (alias: gev)(date, level, status, id)
branches(level, salary, amount, id)
Task: Find name from transactions where a matching record exists in branches with the same status.
SQL: | SELECT name FROM transactions AS gev
WHERE EXISTS (
SELECT 1 FROM branches AS agov
WHERE agov.status = gev.status
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "gev",
"inner_alias": "agov",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "gev.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00630 | train |
v3 | Schema:
managers (alias: hac)(id, level, status, value)
categories(value, type, id, name)
Task: Retrieve amount from managers with value above the AVG(value) of categories rows sharing the same status.
SQL: | SELECT amount FROM managers AS hac
WHERE value > (
SELECT AVG(value) FROM categories AS egiv
WHERE egiv.status = hac.status
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "hac",
"inner_alias": "egiv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "hac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00631 | train |
v2 | Schema:
items (alias: ikob)(id, salary, status, type)
customers(code, id, name, type)
Task: Find amount from items where a matching record exists in customers with the same code.
SQL: | SELECT amount FROM items AS ikob
WHERE EXISTS (
SELECT 1 FROM customers AS lex
WHERE lex.code = ikob.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "ikob",
"inner_alias": "lex",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "ikob.code",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00632 | train |
v1 | Schema:
transactions (alias: gev)(value, name, amount, level)
invoices(status, salary, code, level)
Task: Retrieve amount from transactions whose id is found in invoices rows where type matches the outer record.
SQL: | SELECT amount FROM transactions AS gev
WHERE id IN (
SELECT id FROM invoices AS fal
WHERE fal.type = gev.type
); | {
"outer_table": "transactions",
"inner_table": "invoices",
"outer_alias": "gev",
"inner_alias": "fal",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "gev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00633 | train |
v1 | Schema:
staff (alias: xnob)(salary, id, amount, code)
accounts(value, amount, status, salary)
Task: Retrieve code from staff whose id is found in accounts rows where code matches the outer record.
SQL: | SELECT code FROM staff AS xnob
WHERE id IN (
SELECT id FROM accounts AS jac
WHERE jac.code = xnob.code
); | {
"outer_table": "staff",
"inner_table": "accounts",
"outer_alias": "xnob",
"inner_alias": "jac",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "xnob.code",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00634 | train |
v1 | Schema:
orders (alias: kab)(salary, id, type, name)
products(date, level, salary, amount)
Task: Select salary from orders where code exists in products for the same id.
SQL: | SELECT salary FROM orders AS kab
WHERE code IN (
SELECT code FROM products AS nad
WHERE nad.id = kab.id
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "kab",
"inner_alias": "nad",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "kab.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00635 | train |
v2 | Schema:
accounts (alias: jac)(date, amount, salary, code)
branches(date, salary, amount, name)
Task: Find code from accounts where a matching record exists in branches with the same type.
SQL: | SELECT code FROM accounts AS jac
WHERE EXISTS (
SELECT 1 FROM branches AS agov
WHERE agov.type = jac.type
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "jac",
"inner_alias": "agov",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "jac.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00636 | train |
v2 | Schema:
managers (alias: hac)(code, amount, value, status)
transactions(level, value, name, amount)
Task: Find salary from managers where a matching record exists in transactions with the same status.
SQL: | SELECT salary FROM managers AS hac
WHERE EXISTS (
SELECT 1 FROM transactions AS gev
WHERE gev.status = hac.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "hac",
"inner_alias": "gev",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "hac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00637 | train |
v2 | Schema:
products (alias: nad)(salary, status, name, id)
transactions(type, salary, code, id)
Task: Retrieve salary from products that have at least one corresponding entry in transactions sharing the same type.
SQL: | SELECT salary FROM products AS nad
WHERE EXISTS (
SELECT 1 FROM transactions AS gev
WHERE gev.type = nad.type
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "nad",
"inner_alias": "gev",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "nad.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00638 | train |
v2 | Schema:
staff (alias: xnob)(type, value, salary, code)
tasks(amount, value, code, salary)
Task: Find value from staff where a matching record exists in tasks with the same status.
SQL: | SELECT value FROM staff AS xnob
WHERE EXISTS (
SELECT 1 FROM tasks AS znob
WHERE znob.status = xnob.status
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "xnob",
"inner_alias": "znob",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "xnob.status",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00639 | train |
v1 | Schema:
tasks (alias: znob)(level, status, code, type)
branches(code, date, amount, type)
Task: Select amount from tasks where type exists in branches for the same level.
SQL: | SELECT amount FROM tasks AS znob
WHERE type IN (
SELECT type FROM branches AS agov
WHERE agov.level = znob.level
); | {
"outer_table": "tasks",
"inner_table": "branches",
"outer_alias": "znob",
"inner_alias": "agov",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "znob.level",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00640 | train |
v2 | Schema:
schedules (alias: vmob)(id, code, salary, level)
staff(id, level, code, value)
Task: Retrieve id from schedules that have at least one corresponding entry in staff sharing the same id.
SQL: | SELECT id FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM staff AS xnob
WHERE xnob.id = vmob.id
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "vmob",
"inner_alias": "xnob",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "vmob.id",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00641 | train |
v1 | Schema:
managers (alias: hac)(name, amount, id, date)
branches(code, id, type, salary)
Task: Find salary from managers where id appears in branches entries with matching status.
SQL: | SELECT salary FROM managers AS hac
WHERE id IN (
SELECT id FROM branches AS agov
WHERE agov.status = hac.status
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "hac",
"inner_alias": "agov",
"proj_col": "salary",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "hac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00642 | train |
v3 | Schema:
schedules (alias: vmob)(id, status, code, salary)
accounts(status, level, type, name)
Task: Retrieve name from schedules with salary above the MAX(value) of accounts rows sharing the same code.
SQL: | SELECT name FROM schedules AS vmob
WHERE salary > (
SELECT MAX(value) FROM accounts AS jac
WHERE jac.code = vmob.code
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "vmob",
"inner_alias": "jac",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "vmob.code",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00643 | train |
v2 | Schema:
orders (alias: kab)(id, level, amount, salary)
employees(name, type, level, salary)
Task: Retrieve amount from orders that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT amount FROM orders AS kab
WHERE EXISTS (
SELECT 1 FROM employees AS bev
WHERE bev.id = kab.id
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "kab",
"inner_alias": "bev",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "kab.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00644 | train |
v2 | Schema:
schedules (alias: vmob)(value, type, salary, status)
managers(salary, status, date, type)
Task: Find code from schedules where a matching record exists in managers with the same status.
SQL: | SELECT code FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM managers AS hac
WHERE hac.status = vmob.status
); | {
"outer_table": "schedules",
"inner_table": "managers",
"outer_alias": "vmob",
"inner_alias": "hac",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "vmob.status",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00645 | train |
v3 | Schema:
items (alias: ikob)(level, id, amount, type)
schedules(code, date, type, status)
Task: Retrieve salary from items with salary above the AVG(salary) of schedules rows sharing the same id.
SQL: | SELECT salary FROM items AS ikob
WHERE salary > (
SELECT AVG(salary) FROM schedules AS vmob
WHERE vmob.id = ikob.id
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "ikob",
"inner_alias": "vmob",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ikob.id",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00646 | train |
v3 | Schema:
managers (alias: hac)(level, value, status, date)
products(value, code, id, date)
Task: Retrieve amount from managers with amount above the AVG(amount) of products rows sharing the same level.
SQL: | SELECT amount FROM managers AS hac
WHERE amount > (
SELECT AVG(amount) FROM products AS nad
WHERE nad.level = hac.level
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "hac",
"inner_alias": "nad",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "hac.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00647 | train |
v1 | Schema:
sales (alias: cif)(id, level, status, amount)
transactions(salary, amount, id, value)
Task: Find amount from sales where status appears in transactions entries with matching id.
SQL: | SELECT amount FROM sales AS cif
WHERE status IN (
SELECT status FROM transactions AS gev
WHERE gev.id = cif.id
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "cif",
"inner_alias": "gev",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cif.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00648 | train |
v1 | Schema:
schedules (alias: vmob)(type, status, id, date)
projects(code, salary, id, name)
Task: Select salary from schedules where code exists in projects for the same type.
SQL: | SELECT salary FROM schedules AS vmob
WHERE code IN (
SELECT code FROM projects AS uliv
WHERE uliv.type = vmob.type
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "vmob",
"inner_alias": "uliv",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "vmob.type",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00649 | train |
v2 | Schema:
departments (alias: dov)(salary, date, amount, status)
employees(amount, name, code, status)
Task: Retrieve amount from departments that have at least one corresponding entry in employees sharing the same code.
SQL: | SELECT amount FROM departments AS dov
WHERE EXISTS (
SELECT 1 FROM employees AS bev
WHERE bev.code = dov.code
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dov",
"inner_alias": "bev",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "dov.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00650 | train |
v2 | Schema:
regions (alias: okiv)(type, status, salary, id)
schedules(value, code, salary, status)
Task: Find id from regions where a matching record exists in schedules with the same code.
SQL: | SELECT id FROM regions AS okiv
WHERE EXISTS (
SELECT 1 FROM schedules AS vmob
WHERE vmob.code = okiv.code
); | {
"outer_table": "regions",
"inner_table": "schedules",
"outer_alias": "okiv",
"inner_alias": "vmob",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "okiv.code",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00651 | train |
v3 | Schema:
schedules (alias: vmob)(id, salary, code, level)
departments(id, salary, amount, value)
Task: Find name from schedules where value exceeds the count of value from departments for the same id.
SQL: | SELECT name FROM schedules AS vmob
WHERE value > (
SELECT COUNT(value) FROM departments AS dov
WHERE dov.id = vmob.id
); | {
"outer_table": "schedules",
"inner_table": "departments",
"outer_alias": "vmob",
"inner_alias": "dov",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "vmob.id",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00652 | train |
v2 | Schema:
employees (alias: bev)(type, name, value, id)
tasks(amount, value, salary, level)
Task: Find name from employees where a matching record exists in tasks with the same id.
SQL: | SELECT name FROM employees AS bev
WHERE EXISTS (
SELECT 1 FROM tasks AS znob
WHERE znob.id = bev.id
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "bev",
"inner_alias": "znob",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "bev.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00653 | train |
v1 | Schema:
requests (alias: ejof)(type, amount, value, status)
invoices(type, value, amount, salary)
Task: Select id from requests where status exists in invoices for the same type.
SQL: | SELECT id FROM requests AS ejof
WHERE status IN (
SELECT status FROM invoices AS fal
WHERE fal.type = ejof.type
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ejof",
"inner_alias": "fal",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ejof.type",
"token_group": "T2",
"fan_out": 70
} | T2 | cs9_fixed_v1_train_00654 | train |
v3 | Schema:
products (alias: nad)(level, type, code, date)
schedules(code, name, id, date)
Task: Retrieve id from products with salary above the COUNT(amount) of schedules rows sharing the same type.
SQL: | SELECT id FROM products AS nad
WHERE salary > (
SELECT COUNT(amount) FROM schedules AS vmob
WHERE vmob.type = nad.type
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "nad",
"inner_alias": "vmob",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "nad.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00655 | train |
v1 | Schema:
categories (alias: egiv)(level, code, date, amount)
managers(value, date, salary, level)
Task: Find amount from categories where code appears in managers entries with matching status.
SQL: | SELECT amount FROM categories AS egiv
WHERE code IN (
SELECT code FROM managers AS hac
WHERE hac.status = egiv.status
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "egiv",
"inner_alias": "hac",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "egiv.status",
"token_group": "T2",
"fan_out": 80
} | T2 | cs9_fixed_v1_train_00656 | train |
v2 | Schema:
regions (alias: okiv)(salary, value, code, type)
projects(name, id, value, status)
Task: Retrieve value from regions that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT value FROM regions AS okiv
WHERE EXISTS (
SELECT 1 FROM projects AS uliv
WHERE uliv.code = okiv.code
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "okiv",
"inner_alias": "uliv",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "okiv.code",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00657 | train |
v1 | Schema:
shipments (alias: vnob)(status, date, name, salary)
requests(date, value, level, name)
Task: Retrieve amount from shipments whose type is found in requests rows where type matches the outer record.
SQL: | SELECT amount FROM shipments AS vnob
WHERE type IN (
SELECT type FROM requests AS ejof
WHERE ejof.type = vnob.type
); | {
"outer_table": "shipments",
"inner_table": "requests",
"outer_alias": "vnob",
"inner_alias": "ejof",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "vnob.type",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00658 | train |
v2 | Schema:
schedules (alias: vmob)(code, value, date, level)
requests(type, amount, code, name)
Task: Retrieve name from schedules that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT name FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM requests AS ejof
WHERE ejof.status = vmob.status
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "vmob",
"inner_alias": "ejof",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "vmob.status",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00659 | train |
v2 | Schema:
customers (alias: lex)(value, amount, name, level)
branches(level, code, value, status)
Task: Retrieve id from customers that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT id FROM customers AS lex
WHERE EXISTS (
SELECT 1 FROM branches AS agov
WHERE agov.level = lex.level
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "lex",
"inner_alias": "agov",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "lex.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00660 | train |
v1 | Schema:
orders (alias: kab)(name, type, salary, id)
tasks(salary, level, code, status)
Task: Find id from orders where type appears in tasks entries with matching status.
SQL: | SELECT id FROM orders AS kab
WHERE type IN (
SELECT type FROM tasks AS znob
WHERE znob.status = kab.status
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "kab",
"inner_alias": "znob",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "kab.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00661 | train |
v2 | Schema:
shipments (alias: vnob)(level, status, value, type)
regions(id, type, level, date)
Task: Retrieve value from shipments that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT value FROM shipments AS vnob
WHERE EXISTS (
SELECT 1 FROM regions AS okiv
WHERE okiv.status = vnob.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "vnob",
"inner_alias": "okiv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "vnob.status",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00662 | train |
v3 | Schema:
tasks (alias: znob)(type, salary, id, date)
categories(salary, amount, value, id)
Task: Retrieve id from tasks with amount above the COUNT(salary) of categories rows sharing the same code.
SQL: | SELECT id FROM tasks AS znob
WHERE amount > (
SELECT COUNT(salary) FROM categories AS egiv
WHERE egiv.code = znob.code
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "znob",
"inner_alias": "egiv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "znob.code",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00663 | train |
v2 | Schema:
employees (alias: bev)(status, value, code, salary)
accounts(name, value, salary, date)
Task: Find value from employees where a matching record exists in accounts with the same id.
SQL: | SELECT value FROM employees AS bev
WHERE EXISTS (
SELECT 1 FROM accounts AS jac
WHERE jac.id = bev.id
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "bev",
"inner_alias": "jac",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "bev.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00664 | train |
v2 | Schema:
employees (alias: bev)(salary, id, value, status)
regions(level, id, value, date)
Task: Find salary from employees where a matching record exists in regions with the same status.
SQL: | SELECT salary FROM employees AS bev
WHERE EXISTS (
SELECT 1 FROM regions AS okiv
WHERE okiv.status = bev.status
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "bev",
"inner_alias": "okiv",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "bev.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00665 | train |
v2 | Schema:
tasks (alias: znob)(type, level, value, code)
staff(level, date, id, amount)
Task: Retrieve salary from tasks that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT salary FROM tasks AS znob
WHERE EXISTS (
SELECT 1 FROM staff AS xnob
WHERE xnob.code = znob.code
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "znob",
"inner_alias": "xnob",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "znob.code",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00666 | train |
v1 | Schema:
sales (alias: cif)(salary, amount, id, status)
customers(type, code, amount, value)
Task: Retrieve name from sales whose id is found in customers rows where type matches the outer record.
SQL: | SELECT name FROM sales AS cif
WHERE id IN (
SELECT id FROM customers AS lex
WHERE lex.type = cif.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "cif",
"inner_alias": "lex",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "cif.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00667 | train |
v2 | Schema:
categories (alias: egiv)(date, level, value, code)
orders(level, name, status, id)
Task: Find amount from categories where a matching record exists in orders with the same level.
SQL: | SELECT amount FROM categories AS egiv
WHERE EXISTS (
SELECT 1 FROM orders AS kab
WHERE kab.level = egiv.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "egiv",
"inner_alias": "kab",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "egiv.level",
"token_group": "T2",
"fan_out": 80
} | T2 | cs9_fixed_v1_train_00668 | train |
v1 | Schema:
schedules (alias: vmob)(level, salary, name, code)
products(type, id, code, value)
Task: Select id from schedules where type exists in products for the same id.
SQL: | SELECT id FROM schedules AS vmob
WHERE type IN (
SELECT type FROM products AS nad
WHERE nad.id = vmob.id
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "vmob",
"inner_alias": "nad",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "vmob.id",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00669 | train |
v3 | Schema:
regions (alias: okiv)(amount, type, level, code)
invoices(salary, code, date, status)
Task: Retrieve code from regions with value above the SUM(amount) of invoices rows sharing the same id.
SQL: | SELECT code FROM regions AS okiv
WHERE value > (
SELECT SUM(amount) FROM invoices AS fal
WHERE fal.id = okiv.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "okiv",
"inner_alias": "fal",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "okiv.id",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00670 | train |
v1 | Schema:
products (alias: nad)(id, name, date, salary)
transactions(level, salary, value, type)
Task: Retrieve amount from products whose type is found in transactions rows where level matches the outer record.
SQL: | SELECT amount FROM products AS nad
WHERE type IN (
SELECT type FROM transactions AS gev
WHERE gev.level = nad.level
); | {
"outer_table": "products",
"inner_table": "transactions",
"outer_alias": "nad",
"inner_alias": "gev",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "nad.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00671 | train |
v1 | Schema:
shipments (alias: vnob)(code, amount, salary, name)
managers(name, date, code, type)
Task: Select value from shipments where status exists in managers for the same type.
SQL: | SELECT value FROM shipments AS vnob
WHERE status IN (
SELECT status FROM managers AS hac
WHERE hac.type = vnob.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "vnob",
"inner_alias": "hac",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "vnob.type",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00672 | train |
v3 | Schema:
items (alias: ikob)(status, amount, level, id)
branches(value, status, date, id)
Task: Retrieve name from items with amount above the MAX(amount) of branches rows sharing the same code.
SQL: | SELECT name FROM items AS ikob
WHERE amount > (
SELECT MAX(amount) FROM branches AS agov
WHERE agov.code = ikob.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "ikob",
"inner_alias": "agov",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ikob.code",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00673 | train |
v3 | Schema:
customers (alias: lex)(name, salary, code, amount)
projects(name, id, code, date)
Task: Retrieve amount from customers with value above the MIN(amount) of projects rows sharing the same level.
SQL: | SELECT amount FROM customers AS lex
WHERE value > (
SELECT MIN(amount) FROM projects AS uliv
WHERE uliv.level = lex.level
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "lex",
"inner_alias": "uliv",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lex.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00674 | train |
v1 | Schema:
managers (alias: hac)(value, type, name, salary)
staff(name, date, code, id)
Task: Find id from managers where status appears in staff entries with matching level.
SQL: | SELECT id FROM managers AS hac
WHERE status IN (
SELECT status FROM staff AS xnob
WHERE xnob.level = hac.level
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "hac",
"inner_alias": "xnob",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "hac.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00675 | train |
v2 | Schema:
tasks (alias: znob)(id, amount, date, salary)
invoices(name, date, value, status)
Task: Find salary from tasks where a matching record exists in invoices with the same code.
SQL: | SELECT salary FROM tasks AS znob
WHERE EXISTS (
SELECT 1 FROM invoices AS fal
WHERE fal.code = znob.code
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "znob",
"inner_alias": "fal",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "znob.code",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00676 | train |
v3 | Schema:
categories (alias: egiv)(amount, salary, name, status)
shipments(date, type, amount, status)
Task: Retrieve value from categories with value above the AVG(value) of shipments rows sharing the same id.
SQL: | SELECT value FROM categories AS egiv
WHERE value > (
SELECT AVG(value) FROM shipments AS vnob
WHERE vnob.id = egiv.id
); | {
"outer_table": "categories",
"inner_table": "shipments",
"outer_alias": "egiv",
"inner_alias": "vnob",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "egiv.id",
"token_group": "T2",
"fan_out": 80
} | T2 | cs9_fixed_v1_train_00677 | train |
v3 | Schema:
invoices (alias: fal)(name, salary, level, value)
tasks(salary, code, status, type)
Task: Retrieve salary from invoices with salary above the MAX(salary) of tasks rows sharing the same id.
SQL: | SELECT salary FROM invoices AS fal
WHERE salary > (
SELECT MAX(salary) FROM tasks AS znob
WHERE znob.id = fal.id
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "fal",
"inner_alias": "znob",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "fal.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00678 | train |
v2 | Schema:
accounts (alias: jac)(name, type, salary, code)
branches(value, name, type, code)
Task: Retrieve name from accounts that have at least one corresponding entry in branches sharing the same level.
SQL: | SELECT name FROM accounts AS jac
WHERE EXISTS (
SELECT 1 FROM branches AS agov
WHERE agov.level = jac.level
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "jac",
"inner_alias": "agov",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "jac.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00679 | train |
v2 | Schema:
categories (alias: egiv)(name, type, date, salary)
projects(type, value, code, amount)
Task: Find id from categories where a matching record exists in projects with the same code.
SQL: | SELECT id FROM categories AS egiv
WHERE EXISTS (
SELECT 1 FROM projects AS uliv
WHERE uliv.code = egiv.code
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "egiv",
"inner_alias": "uliv",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "egiv.code",
"token_group": "T2",
"fan_out": 80
} | T2 | cs9_fixed_v1_train_00680 | train |
v1 | Schema:
accounts (alias: jac)(id, salary, date, name)
branches(id, name, code, level)
Task: Select id from accounts where type exists in branches for the same code.
SQL: | SELECT id FROM accounts AS jac
WHERE type IN (
SELECT type FROM branches AS agov
WHERE agov.code = jac.code
); | {
"outer_table": "accounts",
"inner_table": "branches",
"outer_alias": "jac",
"inner_alias": "agov",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "jac.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00681 | train |
v1 | Schema:
accounts (alias: jac)(value, id, type, name)
staff(date, level, value, amount)
Task: Select amount from accounts where id exists in staff for the same status.
SQL: | SELECT amount FROM accounts AS jac
WHERE id IN (
SELECT id FROM staff AS xnob
WHERE xnob.status = jac.status
); | {
"outer_table": "accounts",
"inner_table": "staff",
"outer_alias": "jac",
"inner_alias": "xnob",
"proj_col": "amount",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "jac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00682 | train |
v3 | Schema:
invoices (alias: fal)(type, amount, value, status)
accounts(level, type, code, date)
Task: Retrieve value from invoices with salary above the SUM(amount) of accounts rows sharing the same type.
SQL: | SELECT value FROM invoices AS fal
WHERE salary > (
SELECT SUM(amount) FROM accounts AS jac
WHERE jac.type = fal.type
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "fal",
"inner_alias": "jac",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "fal.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00683 | train |
v3 | Schema:
invoices (alias: fal)(amount, salary, date, id)
products(level, value, type, id)
Task: Retrieve value from invoices with salary above the SUM(value) of products rows sharing the same code.
SQL: | SELECT value FROM invoices AS fal
WHERE salary > (
SELECT SUM(value) FROM products AS nad
WHERE nad.code = fal.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "fal",
"inner_alias": "nad",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "fal.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00684 | train |
v1 | Schema:
requests (alias: ejof)(salary, status, value, type)
employees(salary, code, type, date)
Task: Retrieve value from requests whose status is found in employees rows where type matches the outer record.
SQL: | SELECT value FROM requests AS ejof
WHERE status IN (
SELECT status FROM employees AS bev
WHERE bev.type = ejof.type
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ejof",
"inner_alias": "bev",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ejof.type",
"token_group": "T2",
"fan_out": 70
} | T2 | cs9_fixed_v1_train_00685 | train |
v3 | Schema:
tasks (alias: znob)(level, name, salary, code)
invoices(amount, code, level, name)
Task: Find id from tasks where value exceeds the count of salary from invoices for the same id.
SQL: | SELECT id FROM tasks AS znob
WHERE value > (
SELECT COUNT(salary) FROM invoices AS fal
WHERE fal.id = znob.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "znob",
"inner_alias": "fal",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "znob.id",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00686 | train |
v2 | Schema:
schedules (alias: vmob)(amount, type, code, level)
sales(date, amount, value, type)
Task: Retrieve amount from schedules that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM sales AS cif
WHERE cif.id = vmob.id
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "vmob",
"inner_alias": "cif",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "vmob.id",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00687 | train |
v2 | Schema:
shipments (alias: vnob)(type, name, level, value)
items(value, code, salary, name)
Task: Retrieve amount from shipments that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT amount FROM shipments AS vnob
WHERE EXISTS (
SELECT 1 FROM items AS ikob
WHERE ikob.level = vnob.level
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "vnob",
"inner_alias": "ikob",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "vnob.level",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00688 | train |
v3 | Schema:
tasks (alias: znob)(salary, code, id, status)
managers(value, level, status, amount)
Task: Retrieve name from tasks with amount above the COUNT(value) of managers rows sharing the same level.
SQL: | SELECT name FROM tasks AS znob
WHERE amount > (
SELECT COUNT(value) FROM managers AS hac
WHERE hac.level = znob.level
); | {
"outer_table": "tasks",
"inner_table": "managers",
"outer_alias": "znob",
"inner_alias": "hac",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "znob.level",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00689 | train |
v3 | Schema:
orders (alias: kab)(name, type, date, amount)
managers(code, date, salary, level)
Task: Find value from orders where value exceeds the count of amount from managers for the same type.
SQL: | SELECT value FROM orders AS kab
WHERE value > (
SELECT COUNT(amount) FROM managers AS hac
WHERE hac.type = kab.type
); | {
"outer_table": "orders",
"inner_table": "managers",
"outer_alias": "kab",
"inner_alias": "hac",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "kab.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00690 | train |
v1 | Schema:
schedules (alias: vmob)(amount, name, level, code)
products(code, id, name, level)
Task: Select amount from schedules where id exists in products for the same level.
SQL: | SELECT amount FROM schedules AS vmob
WHERE id IN (
SELECT id FROM products AS nad
WHERE nad.level = vmob.level
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "vmob",
"inner_alias": "nad",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "vmob.level",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00691 | train |
v2 | Schema:
branches (alias: agov)(salary, name, amount, level)
projects(amount, value, status, name)
Task: Retrieve code from branches that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT code FROM branches AS agov
WHERE EXISTS (
SELECT 1 FROM projects AS uliv
WHERE uliv.status = agov.status
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "agov",
"inner_alias": "uliv",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "agov.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00692 | train |
v1 | Schema:
items (alias: ikob)(code, type, date, value)
customers(code, type, status, level)
Task: Select name from items where status exists in customers for the same code.
SQL: | SELECT name FROM items AS ikob
WHERE status IN (
SELECT status FROM customers AS lex
WHERE lex.code = ikob.code
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "ikob",
"inner_alias": "lex",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "ikob.code",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00693 | train |
v1 | Schema:
accounts (alias: jac)(value, status, level, salary)
invoices(status, id, salary, type)
Task: Find amount from accounts where code appears in invoices entries with matching type.
SQL: | SELECT amount FROM accounts AS jac
WHERE code IN (
SELECT code FROM invoices AS fal
WHERE fal.type = jac.type
); | {
"outer_table": "accounts",
"inner_table": "invoices",
"outer_alias": "jac",
"inner_alias": "fal",
"proj_col": "amount",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "jac.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00694 | train |
v1 | Schema:
items (alias: ikob)(amount, code, id, salary)
branches(value, salary, date, amount)
Task: Find amount from items where type appears in branches entries with matching code.
SQL: | SELECT amount FROM items AS ikob
WHERE type IN (
SELECT type FROM branches AS agov
WHERE agov.code = ikob.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "ikob",
"inner_alias": "agov",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "ikob.code",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00695 | train |
v2 | Schema:
projects (alias: uliv)(code, name, salary, status)
tasks(level, status, type, amount)
Task: Find code from projects where a matching record exists in tasks with the same code.
SQL: | SELECT code FROM projects AS uliv
WHERE EXISTS (
SELECT 1 FROM tasks AS znob
WHERE znob.code = uliv.code
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "uliv",
"inner_alias": "znob",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "uliv.code",
"token_group": "T2",
"fan_out": 65
} | T2 | cs9_fixed_v1_train_00696 | train |
v1 | Schema:
regions (alias: okiv)(name, value, status, salary)
branches(type, id, value, status)
Task: Select name from regions where code exists in branches for the same level.
SQL: | SELECT name FROM regions AS okiv
WHERE code IN (
SELECT code FROM branches AS agov
WHERE agov.level = okiv.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "okiv",
"inner_alias": "agov",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "okiv.level",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00697 | train |
v2 | Schema:
schedules (alias: vmob)(value, name, salary, status)
invoices(salary, value, date, status)
Task: Retrieve amount from schedules that have at least one corresponding entry in invoices sharing the same code.
SQL: | SELECT amount FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM invoices AS fal
WHERE fal.code = vmob.code
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "vmob",
"inner_alias": "fal",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "vmob.code",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00698 | train |
v1 | Schema:
orders (alias: kab)(status, salary, type, id)
sales(value, type, status, date)
Task: Find salary from orders where type appears in sales entries with matching id.
SQL: | SELECT salary FROM orders AS kab
WHERE type IN (
SELECT type FROM sales AS cif
WHERE cif.id = kab.id
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "kab",
"inner_alias": "cif",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "kab.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.