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 |
|---|---|---|---|---|---|---|
v1 | Schema:
items (alias: ikob)(type, salary, name, status)
sales(salary, type, level, id)
Task: Retrieve salary from items whose id is found in sales rows where type matches the outer record.
SQL: | SELECT salary FROM items AS ikob
WHERE id IN (
SELECT id FROM sales AS cif
WHERE cif.type = ikob.type
); | {
"outer_table": "items",
"inner_table": "sales",
"outer_alias": "ikob",
"inner_alias": "cif",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ikob.type",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00100 | train |
v3 | Schema:
orders (alias: kab)(name, value, date, code)
accounts(type, id, salary, name)
Task: Find name from orders where value exceeds the average amount from accounts for the same id.
SQL: | SELECT name FROM orders AS kab
WHERE value > (
SELECT AVG(amount) FROM accounts AS jac
WHERE jac.id = kab.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "kab",
"inner_alias": "jac",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "kab.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00101 | train |
v3 | Schema:
sales (alias: cif)(level, amount, code, name)
schedules(amount, value, id, date)
Task: Find amount from sales where value exceeds the maximum value from schedules for the same code.
SQL: | SELECT amount FROM sales AS cif
WHERE value > (
SELECT MAX(value) FROM schedules AS vmob
WHERE vmob.code = cif.code
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "cif",
"inner_alias": "vmob",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "cif.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00102 | train |
v1 | Schema:
items (alias: ikob)(date, code, id, type)
regions(type, value, status, amount)
Task: Retrieve amount from items whose code is found in regions rows where code matches the outer record.
SQL: | SELECT amount FROM items AS ikob
WHERE code IN (
SELECT code FROM regions AS okiv
WHERE okiv.code = ikob.code
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "ikob",
"inner_alias": "okiv",
"proj_col": "amount",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "ikob.code",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00103 | train |
v2 | Schema:
tasks (alias: znob)(code, level, status, date)
categories(code, name, value, amount)
Task: Retrieve id from tasks that have at least one corresponding entry in categories sharing the same id.
SQL: | SELECT id FROM tasks AS znob
WHERE EXISTS (
SELECT 1 FROM categories AS egiv
WHERE egiv.id = znob.id
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "znob",
"inner_alias": "egiv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "znob.id",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00104 | train |
v3 | Schema:
categories (alias: egiv)(level, value, status, id)
employees(code, id, level, amount)
Task: Retrieve amount from categories with salary above the COUNT(amount) of employees rows sharing the same id.
SQL: | SELECT amount FROM categories AS egiv
WHERE salary > (
SELECT COUNT(amount) FROM employees AS bev
WHERE bev.id = egiv.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "egiv",
"inner_alias": "bev",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "egiv.id",
"token_group": "T2",
"fan_out": 80
} | T2 | cs9_fixed_v1_train_00105 | train |
v3 | Schema:
invoices (alias: fal)(value, salary, type, level)
categories(level, name, type, value)
Task: Retrieve value from invoices with amount above the MIN(salary) of categories rows sharing the same level.
SQL: | SELECT value FROM invoices AS fal
WHERE amount > (
SELECT MIN(salary) FROM categories AS egiv
WHERE egiv.level = fal.level
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "fal",
"inner_alias": "egiv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "fal.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00106 | train |
v3 | Schema:
departments (alias: dov)(status, salary, name, amount)
transactions(date, status, name, amount)
Task: Find id from departments where amount exceeds the maximum value from transactions for the same code.
SQL: | SELECT id FROM departments AS dov
WHERE amount > (
SELECT MAX(value) FROM transactions AS gev
WHERE gev.code = dov.code
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dov",
"inner_alias": "gev",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dov.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00107 | train |
v1 | Schema:
shipments (alias: vnob)(salary, code, value, type)
customers(type, salary, id, value)
Task: Find value from shipments where code appears in customers entries with matching status.
SQL: | SELECT value FROM shipments AS vnob
WHERE code IN (
SELECT code FROM customers AS lex
WHERE lex.status = vnob.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "vnob",
"inner_alias": "lex",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "vnob.status",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00108 | train |
v2 | Schema:
tasks (alias: znob)(name, id, code, status)
departments(date, value, type, level)
Task: Retrieve amount from tasks that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT amount FROM tasks AS znob
WHERE EXISTS (
SELECT 1 FROM departments AS dov
WHERE dov.id = znob.id
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "znob",
"inner_alias": "dov",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "znob.id",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00109 | train |
v1 | Schema:
tasks (alias: znob)(code, level, status, name)
categories(amount, salary, level, name)
Task: Find salary from tasks where level appears in categories entries with matching status.
SQL: | SELECT salary FROM tasks AS znob
WHERE level IN (
SELECT level FROM categories AS egiv
WHERE egiv.status = znob.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "znob",
"inner_alias": "egiv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "znob.status",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00110 | train |
v1 | Schema:
employees (alias: bev)(level, name, value, status)
invoices(type, level, status, name)
Task: Select salary from employees where level exists in invoices for the same type.
SQL: | SELECT salary FROM employees AS bev
WHERE level IN (
SELECT level FROM invoices AS fal
WHERE fal.type = bev.type
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "bev",
"inner_alias": "fal",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "bev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00111 | train |
v2 | Schema:
schedules (alias: vmob)(level, date, value, name)
categories(name, type, level, value)
Task: Find code from schedules where a matching record exists in categories with the same code.
SQL: | SELECT code FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM categories AS egiv
WHERE egiv.code = vmob.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "vmob",
"inner_alias": "egiv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "vmob.code",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00112 | train |
v2 | Schema:
sales (alias: cif)(value, code, level, date)
accounts(value, name, type, code)
Task: Find name from sales where a matching record exists in accounts with the same type.
SQL: | SELECT name FROM sales AS cif
WHERE EXISTS (
SELECT 1 FROM accounts AS jac
WHERE jac.type = cif.type
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "cif",
"inner_alias": "jac",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "cif.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00113 | train |
v1 | Schema:
managers (alias: hac)(id, code, name, level)
tasks(type, name, code, amount)
Task: Select amount from managers where status exists in tasks for the same id.
SQL: | SELECT amount FROM managers AS hac
WHERE status IN (
SELECT status FROM tasks AS znob
WHERE znob.id = hac.id
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "hac",
"inner_alias": "znob",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "hac.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00114 | train |
v1 | Schema:
transactions (alias: gev)(code, date, id, level)
shipments(date, level, value, type)
Task: Select amount from transactions where id exists in shipments for the same type.
SQL: | SELECT amount FROM transactions AS gev
WHERE id IN (
SELECT id FROM shipments AS vnob
WHERE vnob.type = gev.type
); | {
"outer_table": "transactions",
"inner_table": "shipments",
"outer_alias": "gev",
"inner_alias": "vnob",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "gev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00115 | train |
v3 | Schema:
orders (alias: kab)(code, id, name, date)
employees(id, type, date, name)
Task: Find id from orders where value exceeds the count of value from employees for the same status.
SQL: | SELECT id FROM orders AS kab
WHERE value > (
SELECT COUNT(value) FROM employees AS bev
WHERE bev.status = kab.status
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "kab",
"inner_alias": "bev",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "kab.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00116 | train |
v2 | Schema:
branches (alias: agov)(amount, id, level, name)
tasks(value, level, salary, status)
Task: Find amount from branches where a matching record exists in tasks with the same id.
SQL: | SELECT amount FROM branches AS agov
WHERE EXISTS (
SELECT 1 FROM tasks AS znob
WHERE znob.id = agov.id
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "agov",
"inner_alias": "znob",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "agov.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00117 | train |
v2 | Schema:
tasks (alias: znob)(name, id, level, date)
projects(type, date, salary, name)
Task: Retrieve id from tasks that have at least one corresponding entry in projects sharing the same status.
SQL: | SELECT id FROM tasks AS znob
WHERE EXISTS (
SELECT 1 FROM projects AS uliv
WHERE uliv.status = znob.status
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "znob",
"inner_alias": "uliv",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "znob.status",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00118 | train |
v2 | Schema:
projects (alias: uliv)(level, status, amount, date)
schedules(code, date, id, level)
Task: Retrieve value from projects that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT value FROM projects AS uliv
WHERE EXISTS (
SELECT 1 FROM schedules AS vmob
WHERE vmob.code = uliv.code
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "uliv",
"inner_alias": "vmob",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "uliv.code",
"token_group": "T2",
"fan_out": 65
} | T2 | cs9_fixed_v1_train_00119 | train |
v1 | Schema:
employees (alias: bev)(name, salary, amount, date)
tasks(amount, id, type, status)
Task: Select amount from employees where type exists in tasks for the same type.
SQL: | SELECT amount FROM employees AS bev
WHERE type IN (
SELECT type FROM tasks AS znob
WHERE znob.type = bev.type
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "bev",
"inner_alias": "znob",
"proj_col": "amount",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "bev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00120 | train |
v2 | Schema:
staff (alias: xnob)(status, id, code, value)
orders(name, type, level, date)
Task: Retrieve amount from staff that have at least one corresponding entry in orders sharing the same id.
SQL: | SELECT amount FROM staff AS xnob
WHERE EXISTS (
SELECT 1 FROM orders AS kab
WHERE kab.id = xnob.id
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "xnob",
"inner_alias": "kab",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "xnob.id",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00121 | train |
v1 | Schema:
invoices (alias: fal)(level, value, name, date)
tasks(id, type, status, date)
Task: Retrieve id from invoices whose code is found in tasks rows where level matches the outer record.
SQL: | SELECT id FROM invoices AS fal
WHERE code IN (
SELECT code FROM tasks AS znob
WHERE znob.level = fal.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "fal",
"inner_alias": "znob",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "fal.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00122 | train |
v1 | Schema:
staff (alias: xnob)(type, name, date, code)
employees(value, name, id, amount)
Task: Retrieve amount from staff whose level is found in employees rows where type matches the outer record.
SQL: | SELECT amount FROM staff AS xnob
WHERE level IN (
SELECT level FROM employees AS bev
WHERE bev.type = xnob.type
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "xnob",
"inner_alias": "bev",
"proj_col": "amount",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "xnob.type",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00123 | train |
v1 | Schema:
employees (alias: bev)(amount, date, code, type)
sales(level, status, value, name)
Task: Select id from employees where level exists in sales for the same type.
SQL: | SELECT id FROM employees AS bev
WHERE level IN (
SELECT level FROM sales AS cif
WHERE cif.type = bev.type
); | {
"outer_table": "employees",
"inner_table": "sales",
"outer_alias": "bev",
"inner_alias": "cif",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "bev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00124 | train |
v3 | Schema:
employees (alias: bev)(name, code, date, status)
staff(amount, level, status, value)
Task: Find id from employees where amount exceeds the count of amount from staff for the same code.
SQL: | SELECT id FROM employees AS bev
WHERE amount > (
SELECT COUNT(amount) FROM staff AS xnob
WHERE xnob.code = bev.code
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "bev",
"inner_alias": "xnob",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "bev.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00125 | train |
v3 | Schema:
managers (alias: hac)(id, amount, type, name)
branches(salary, level, status, amount)
Task: Find id from managers where salary exceeds the average value from branches for the same type.
SQL: | SELECT id FROM managers AS hac
WHERE salary > (
SELECT AVG(value) FROM branches AS agov
WHERE agov.type = hac.type
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "hac",
"inner_alias": "agov",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "hac.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00126 | train |
v1 | Schema:
regions (alias: okiv)(id, code, level, value)
shipments(name, code, id, salary)
Task: Select amount from regions where id exists in shipments for the same id.
SQL: | SELECT amount FROM regions AS okiv
WHERE id IN (
SELECT id FROM shipments AS vnob
WHERE vnob.id = okiv.id
); | {
"outer_table": "regions",
"inner_table": "shipments",
"outer_alias": "okiv",
"inner_alias": "vnob",
"proj_col": "amount",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "okiv.id",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00127 | train |
v1 | Schema:
items (alias: ikob)(date, status, level, id)
shipments(code, salary, type, level)
Task: Find salary from items where type appears in shipments entries with matching type.
SQL: | SELECT salary FROM items AS ikob
WHERE type IN (
SELECT type FROM shipments AS vnob
WHERE vnob.type = ikob.type
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "ikob",
"inner_alias": "vnob",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "ikob.type",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00128 | train |
v3 | Schema:
branches (alias: agov)(id, amount, level, code)
items(id, level, salary, status)
Task: Find code from branches where amount exceeds the total amount from items for the same level.
SQL: | SELECT code FROM branches AS agov
WHERE amount > (
SELECT SUM(amount) FROM items AS ikob
WHERE ikob.level = agov.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "agov",
"inner_alias": "ikob",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "agov.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00129 | train |
v2 | Schema:
sales (alias: cif)(date, type, id, amount)
staff(value, code, salary, date)
Task: Retrieve id from sales that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM sales AS cif
WHERE EXISTS (
SELECT 1 FROM staff AS xnob
WHERE xnob.code = cif.code
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "cif",
"inner_alias": "xnob",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cif.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00130 | train |
v1 | Schema:
customers (alias: lex)(id, salary, value, type)
shipments(date, salary, code, value)
Task: Select id from customers where status exists in shipments for the same status.
SQL: | SELECT id FROM customers AS lex
WHERE status IN (
SELECT status FROM shipments AS vnob
WHERE vnob.status = lex.status
); | {
"outer_table": "customers",
"inner_table": "shipments",
"outer_alias": "lex",
"inner_alias": "vnob",
"proj_col": "id",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "lex.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00131 | train |
v1 | Schema:
transactions (alias: gev)(code, type, status, level)
projects(amount, name, salary, status)
Task: Retrieve code from transactions whose level is found in projects rows where type matches the outer record.
SQL: | SELECT code FROM transactions AS gev
WHERE level IN (
SELECT level FROM projects AS uliv
WHERE uliv.type = gev.type
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "gev",
"inner_alias": "uliv",
"proj_col": "code",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "gev.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00132 | train |
v1 | Schema:
transactions (alias: gev)(code, type, date, id)
requests(salary, amount, date, status)
Task: Find id from transactions where code appears in requests entries with matching status.
SQL: | SELECT id FROM transactions AS gev
WHERE code IN (
SELECT code FROM requests AS ejof
WHERE ejof.status = gev.status
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "gev",
"inner_alias": "ejof",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "gev.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00133 | train |
v2 | Schema:
regions (alias: okiv)(type, value, id, code)
products(type, date, level, status)
Task: Retrieve salary from regions that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT salary FROM regions AS okiv
WHERE EXISTS (
SELECT 1 FROM products AS nad
WHERE nad.code = okiv.code
); | {
"outer_table": "regions",
"inner_table": "products",
"outer_alias": "okiv",
"inner_alias": "nad",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "okiv.code",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00134 | train |
v3 | Schema:
staff (alias: xnob)(type, id, status, code)
shipments(code, id, name, amount)
Task: Find code from staff where value exceeds the average value from shipments for the same level.
SQL: | SELECT code FROM staff AS xnob
WHERE value > (
SELECT AVG(value) FROM shipments AS vnob
WHERE vnob.level = xnob.level
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "xnob",
"inner_alias": "vnob",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "xnob.level",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00135 | train |
v1 | Schema:
branches (alias: agov)(type, code, level, date)
categories(name, date, amount, code)
Task: Find name from branches where status appears in categories entries with matching type.
SQL: | SELECT name FROM branches AS agov
WHERE status IN (
SELECT status FROM categories AS egiv
WHERE egiv.type = agov.type
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "agov",
"inner_alias": "egiv",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "agov.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00136 | train |
v3 | Schema:
shipments (alias: vnob)(salary, name, amount, date)
departments(id, level, status, salary)
Task: Find code from shipments where amount exceeds the minimum value from departments for the same level.
SQL: | SELECT code FROM shipments AS vnob
WHERE amount > (
SELECT MIN(value) FROM departments AS dov
WHERE dov.level = vnob.level
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "vnob",
"inner_alias": "dov",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "vnob.level",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00137 | train |
v2 | Schema:
items (alias: ikob)(id, salary, date, code)
managers(value, name, type, level)
Task: Find name from items where a matching record exists in managers with the same id.
SQL: | SELECT name FROM items AS ikob
WHERE EXISTS (
SELECT 1 FROM managers AS hac
WHERE hac.id = ikob.id
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "ikob",
"inner_alias": "hac",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "ikob.id",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00138 | train |
v3 | Schema:
employees (alias: bev)(salary, date, type, value)
schedules(status, level, amount, value)
Task: Find id from employees where value exceeds the minimum salary from schedules for the same level.
SQL: | SELECT id FROM employees AS bev
WHERE value > (
SELECT MIN(salary) FROM schedules AS vmob
WHERE vmob.level = bev.level
); | {
"outer_table": "employees",
"inner_table": "schedules",
"outer_alias": "bev",
"inner_alias": "vmob",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "bev.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00139 | train |
v3 | Schema:
invoices (alias: fal)(status, type, code, value)
orders(date, value, amount, salary)
Task: Find code from invoices where salary exceeds the count of salary from orders for the same level.
SQL: | SELECT code FROM invoices AS fal
WHERE salary > (
SELECT COUNT(salary) FROM orders AS kab
WHERE kab.level = fal.level
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "fal",
"inner_alias": "kab",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "fal.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00140 | train |
v3 | Schema:
branches (alias: agov)(salary, date, status, id)
employees(code, type, status, level)
Task: Find name from branches where amount exceeds the total salary from employees for the same type.
SQL: | SELECT name FROM branches AS agov
WHERE amount > (
SELECT SUM(salary) FROM employees AS bev
WHERE bev.type = agov.type
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "agov",
"inner_alias": "bev",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "agov.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00141 | train |
v2 | Schema:
schedules (alias: vmob)(code, level, id, amount)
employees(salary, code, type, status)
Task: Find id from schedules where a matching record exists in employees with the same type.
SQL: | SELECT id FROM schedules AS vmob
WHERE EXISTS (
SELECT 1 FROM employees AS bev
WHERE bev.type = vmob.type
); | {
"outer_table": "schedules",
"inner_table": "employees",
"outer_alias": "vmob",
"inner_alias": "bev",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "vmob.type",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00142 | train |
v3 | Schema:
accounts (alias: jac)(amount, level, value, type)
regions(code, name, level, salary)
Task: Retrieve code from accounts with amount above the MAX(amount) of regions rows sharing the same type.
SQL: | SELECT code FROM accounts AS jac
WHERE amount > (
SELECT MAX(amount) FROM regions AS okiv
WHERE okiv.type = jac.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "jac",
"inner_alias": "okiv",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "jac.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00143 | train |
v1 | Schema:
sales (alias: cif)(date, amount, id, level)
transactions(name, status, code, id)
Task: Find id from sales where type appears in transactions entries with matching id.
SQL: | SELECT id FROM sales AS cif
WHERE type IN (
SELECT type FROM transactions AS gev
WHERE gev.id = cif.id
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "cif",
"inner_alias": "gev",
"proj_col": "id",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "cif.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00144 | train |
v1 | Schema:
employees (alias: bev)(date, status, amount, type)
invoices(amount, type, status, id)
Task: Retrieve salary from employees whose level is found in invoices rows where status matches the outer record.
SQL: | SELECT salary FROM employees AS bev
WHERE level IN (
SELECT level FROM invoices AS fal
WHERE fal.status = bev.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "bev",
"inner_alias": "fal",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "bev.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00145 | train |
v1 | Schema:
branches (alias: agov)(type, code, amount, date)
regions(value, salary, amount, id)
Task: Find name from branches where type appears in regions entries with matching status.
SQL: | SELECT name FROM branches AS agov
WHERE type IN (
SELECT type FROM regions AS okiv
WHERE okiv.status = agov.status
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "agov",
"inner_alias": "okiv",
"proj_col": "name",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "agov.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00146 | train |
v2 | Schema:
orders (alias: kab)(code, amount, value, name)
employees(amount, name, type, date)
Task: Find id from orders where a matching record exists in employees with the same id.
SQL: | SELECT id 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": "id",
"join_col": "id",
"correlated_ref": "kab.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00147 | train |
v3 | Schema:
sales (alias: cif)(level, status, id, amount)
branches(code, type, name, value)
Task: Retrieve salary from sales with value above the MIN(salary) of branches rows sharing the same code.
SQL: | SELECT salary FROM sales AS cif
WHERE value > (
SELECT MIN(salary) FROM branches AS agov
WHERE agov.code = cif.code
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "cif",
"inner_alias": "agov",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "cif.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00148 | train |
v2 | Schema:
tasks (alias: znob)(id, level, status, code)
items(level, amount, salary, status)
Task: Retrieve name from tasks that have at least one corresponding entry in items sharing the same type.
SQL: | SELECT name FROM tasks AS znob
WHERE EXISTS (
SELECT 1 FROM items AS ikob
WHERE ikob.type = znob.type
); | {
"outer_table": "tasks",
"inner_table": "items",
"outer_alias": "znob",
"inner_alias": "ikob",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "znob.type",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00149 | train |
v2 | Schema:
categories (alias: egiv)(code, status, salary, type)
orders(id, salary, name, amount)
Task: Retrieve id from categories that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT id FROM categories AS egiv
WHERE EXISTS (
SELECT 1 FROM orders AS kab
WHERE kab.code = egiv.code
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "egiv",
"inner_alias": "kab",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "egiv.code",
"token_group": "T2",
"fan_out": 80
} | T2 | cs9_fixed_v1_train_00150 | train |
v2 | Schema:
shipments (alias: vnob)(type, id, level, name)
staff(date, value, name, status)
Task: Retrieve salary from shipments that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT salary FROM shipments AS vnob
WHERE EXISTS (
SELECT 1 FROM staff AS xnob
WHERE xnob.code = vnob.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "vnob",
"inner_alias": "xnob",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "vnob.code",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00151 | train |
v3 | Schema:
transactions (alias: gev)(name, salary, amount, id)
schedules(name, status, id, amount)
Task: Retrieve value from transactions with salary above the AVG(salary) of schedules rows sharing the same level.
SQL: | SELECT value FROM transactions AS gev
WHERE salary > (
SELECT AVG(salary) FROM schedules AS vmob
WHERE vmob.level = gev.level
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "gev",
"inner_alias": "vmob",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "gev.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00152 | train |
v3 | Schema:
accounts (alias: jac)(salary, value, status, date)
departments(name, type, level, id)
Task: Find name from accounts where amount exceeds the average amount from departments for the same code.
SQL: | SELECT name FROM accounts AS jac
WHERE amount > (
SELECT AVG(amount) FROM departments AS dov
WHERE dov.code = jac.code
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "jac",
"inner_alias": "dov",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "jac.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00153 | train |
v1 | Schema:
requests (alias: ejof)(level, name, date, amount)
staff(date, id, value, level)
Task: Select code from requests where code exists in staff for the same type.
SQL: | SELECT code FROM requests AS ejof
WHERE code IN (
SELECT code FROM staff AS xnob
WHERE xnob.type = ejof.type
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ejof",
"inner_alias": "xnob",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "ejof.type",
"token_group": "T2",
"fan_out": 70
} | T2 | cs9_fixed_v1_train_00154 | train |
v1 | Schema:
invoices (alias: fal)(salary, type, name, value)
staff(type, salary, value, level)
Task: Select name from invoices where type exists in staff for the same id.
SQL: | SELECT name FROM invoices AS fal
WHERE type IN (
SELECT type FROM staff AS xnob
WHERE xnob.id = fal.id
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "fal",
"inner_alias": "xnob",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "fal.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00155 | train |
v1 | Schema:
accounts (alias: jac)(value, date, status, name)
departments(level, value, code, amount)
Task: Find id from accounts where type appears in departments entries with matching type.
SQL: | SELECT id FROM accounts AS jac
WHERE type IN (
SELECT type FROM departments AS dov
WHERE dov.type = jac.type
); | {
"outer_table": "accounts",
"inner_table": "departments",
"outer_alias": "jac",
"inner_alias": "dov",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "jac.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00156 | train |
v3 | Schema:
tasks (alias: znob)(status, salary, name, value)
invoices(salary, level, status, id)
Task: Find value from tasks where value exceeds the maximum value from invoices for the same type.
SQL: | SELECT value FROM tasks AS znob
WHERE value > (
SELECT MAX(value) FROM invoices AS fal
WHERE fal.type = znob.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "znob",
"inner_alias": "fal",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "znob.type",
"token_group": "T2",
"fan_out": 35
} | T2 | cs9_fixed_v1_train_00157 | train |
v2 | Schema:
accounts (alias: jac)(value, type, amount, name)
requests(status, name, level, id)
Task: Retrieve code from accounts that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT code FROM accounts AS jac
WHERE EXISTS (
SELECT 1 FROM requests AS ejof
WHERE ejof.status = jac.status
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "jac",
"inner_alias": "ejof",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "jac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00158 | train |
v1 | Schema:
products (alias: nad)(status, type, id, amount)
regions(id, date, code, level)
Task: Select value from products where status exists in regions for the same level.
SQL: | SELECT value FROM products AS nad
WHERE status IN (
SELECT status FROM regions AS okiv
WHERE okiv.level = nad.level
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "nad",
"inner_alias": "okiv",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "nad.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00159 | train |
v1 | Schema:
regions (alias: okiv)(id, code, date, type)
orders(id, salary, type, code)
Task: Retrieve code from regions whose status is found in orders rows where id matches the outer record.
SQL: | SELECT code FROM regions AS okiv
WHERE status IN (
SELECT status FROM orders AS kab
WHERE kab.id = okiv.id
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "okiv",
"inner_alias": "kab",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "okiv.id",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00160 | train |
v3 | Schema:
managers (alias: hac)(code, salary, value, status)
departments(date, amount, id, salary)
Task: Retrieve value from managers with amount above the MIN(value) of departments rows sharing the same type.
SQL: | SELECT value FROM managers AS hac
WHERE amount > (
SELECT MIN(value) FROM departments AS dov
WHERE dov.type = hac.type
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "hac",
"inner_alias": "dov",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "hac.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00161 | train |
v3 | Schema:
employees (alias: bev)(value, type, amount, salary)
shipments(status, date, level, amount)
Task: Retrieve amount from employees with salary above the MIN(amount) of shipments rows sharing the same code.
SQL: | SELECT amount FROM employees AS bev
WHERE salary > (
SELECT MIN(amount) FROM shipments AS vnob
WHERE vnob.code = bev.code
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "bev",
"inner_alias": "vnob",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "bev.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00162 | train |
v3 | Schema:
schedules (alias: vmob)(value, date, id, code)
branches(type, id, value, status)
Task: Find value from schedules where salary exceeds the average amount from branches for the same status.
SQL: | SELECT value FROM schedules AS vmob
WHERE salary > (
SELECT AVG(amount) FROM branches AS agov
WHERE agov.status = vmob.status
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "vmob",
"inner_alias": "agov",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "vmob.status",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00163 | train |
v3 | Schema:
orders (alias: kab)(date, level, amount, id)
requests(amount, date, code, level)
Task: Retrieve code from orders with value above the MAX(value) of requests rows sharing the same id.
SQL: | SELECT code FROM orders AS kab
WHERE value > (
SELECT MAX(value) FROM requests AS ejof
WHERE ejof.id = kab.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "kab",
"inner_alias": "ejof",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "kab.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00164 | train |
v2 | Schema:
managers (alias: hac)(code, name, level, value)
customers(value, date, level, amount)
Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT value FROM managers AS hac
WHERE EXISTS (
SELECT 1 FROM customers AS lex
WHERE lex.status = hac.status
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "hac",
"inner_alias": "lex",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "hac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00165 | train |
v2 | Schema:
shipments (alias: vnob)(date, type, name, level)
departments(salary, code, type, name)
Task: Retrieve name from shipments that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT name FROM shipments AS vnob
WHERE EXISTS (
SELECT 1 FROM departments AS dov
WHERE dov.id = vnob.id
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "vnob",
"inner_alias": "dov",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "vnob.id",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00166 | train |
v3 | Schema:
regions (alias: okiv)(level, id, date, name)
tasks(name, salary, id, type)
Task: Find code from regions where value exceeds the total salary from tasks for the same status.
SQL: | SELECT code FROM regions AS okiv
WHERE value > (
SELECT SUM(salary) FROM tasks AS znob
WHERE znob.status = okiv.status
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "okiv",
"inner_alias": "znob",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "okiv.status",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00167 | train |
v3 | Schema:
sales (alias: cif)(type, id, level, date)
categories(name, status, amount, level)
Task: Retrieve value from sales with amount above the COUNT(value) of categories rows sharing the same id.
SQL: | SELECT value FROM sales AS cif
WHERE amount > (
SELECT COUNT(value) FROM categories AS egiv
WHERE egiv.id = cif.id
); | {
"outer_table": "sales",
"inner_table": "categories",
"outer_alias": "cif",
"inner_alias": "egiv",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "cif.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00168 | train |
v1 | Schema:
staff (alias: xnob)(value, level, id, salary)
customers(type, level, salary, status)
Task: Find id from staff where id appears in customers entries with matching code.
SQL: | SELECT id FROM staff AS xnob
WHERE id IN (
SELECT id FROM customers AS lex
WHERE lex.code = xnob.code
); | {
"outer_table": "staff",
"inner_table": "customers",
"outer_alias": "xnob",
"inner_alias": "lex",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "xnob.code",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00169 | train |
v3 | Schema:
schedules (alias: vmob)(amount, type, salary, status)
staff(id, code, level, date)
Task: Find id from schedules where amount exceeds the minimum amount from staff for the same id.
SQL: | SELECT id FROM schedules AS vmob
WHERE amount > (
SELECT MIN(amount) FROM staff AS xnob
WHERE xnob.id = vmob.id
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "vmob",
"inner_alias": "xnob",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "vmob.id",
"token_group": "T2",
"fan_out": 50
} | T2 | cs9_fixed_v1_train_00170 | train |
v1 | Schema:
items (alias: ikob)(name, date, id, value)
products(level, status, code, type)
Task: Select id from items where id exists in products for the same id.
SQL: | SELECT id FROM items AS ikob
WHERE id IN (
SELECT id FROM products AS nad
WHERE nad.id = ikob.id
); | {
"outer_table": "items",
"inner_table": "products",
"outer_alias": "ikob",
"inner_alias": "nad",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ikob.id",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00171 | train |
v2 | Schema:
employees (alias: bev)(date, level, status, amount)
departments(amount, type, value, salary)
Task: Retrieve salary from employees that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT salary FROM employees AS bev
WHERE EXISTS (
SELECT 1 FROM departments AS dov
WHERE dov.level = bev.level
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "bev",
"inner_alias": "dov",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "bev.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00172 | train |
v2 | Schema:
projects (alias: uliv)(amount, date, value, id)
tasks(id, amount, code, level)
Task: Retrieve code from projects that have at least one corresponding entry in tasks sharing the same level.
SQL: | SELECT code FROM projects AS uliv
WHERE EXISTS (
SELECT 1 FROM tasks AS znob
WHERE znob.level = uliv.level
); | {
"outer_table": "projects",
"inner_table": "tasks",
"outer_alias": "uliv",
"inner_alias": "znob",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "uliv.level",
"token_group": "T2",
"fan_out": 65
} | T2 | cs9_fixed_v1_train_00173 | train |
v1 | Schema:
orders (alias: kab)(salary, amount, type, code)
items(date, id, level, type)
Task: Find value from orders where status appears in items entries with matching id.
SQL: | SELECT value FROM orders AS kab
WHERE status IN (
SELECT status FROM items AS ikob
WHERE ikob.id = kab.id
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "kab",
"inner_alias": "ikob",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "kab.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00174 | train |
v3 | Schema:
products (alias: nad)(level, code, salary, amount)
branches(code, level, value, name)
Task: Find value from products where salary exceeds the count of value from branches for the same status.
SQL: | SELECT value FROM products AS nad
WHERE salary > (
SELECT COUNT(value) FROM branches AS agov
WHERE agov.status = nad.status
); | {
"outer_table": "products",
"inner_table": "branches",
"outer_alias": "nad",
"inner_alias": "agov",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "nad.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00175 | train |
v3 | Schema:
staff (alias: xnob)(name, salary, code, value)
managers(status, level, amount, name)
Task: Retrieve code from staff with salary above the COUNT(value) of managers rows sharing the same level.
SQL: | SELECT code FROM staff AS xnob
WHERE salary > (
SELECT COUNT(value) FROM managers AS hac
WHERE hac.level = xnob.level
); | {
"outer_table": "staff",
"inner_table": "managers",
"outer_alias": "xnob",
"inner_alias": "hac",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "xnob.level",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00176 | train |
v3 | Schema:
items (alias: ikob)(value, salary, date, status)
employees(salary, name, code, value)
Task: Retrieve name from items with salary above the MIN(salary) of employees rows sharing the same level.
SQL: | SELECT name FROM items AS ikob
WHERE salary > (
SELECT MIN(salary) FROM employees AS bev
WHERE bev.level = ikob.level
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "ikob",
"inner_alias": "bev",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ikob.level",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00177 | train |
v2 | Schema:
staff (alias: xnob)(amount, code, name, date)
orders(amount, name, id, level)
Task: Find amount from staff where a matching record exists in orders with the same type.
SQL: | SELECT amount FROM staff AS xnob
WHERE EXISTS (
SELECT 1 FROM orders AS kab
WHERE kab.type = xnob.type
); | {
"outer_table": "staff",
"inner_table": "orders",
"outer_alias": "xnob",
"inner_alias": "kab",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "xnob.type",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00178 | train |
v1 | Schema:
items (alias: ikob)(value, date, amount, id)
schedules(date, salary, level, value)
Task: Select name from items where code exists in schedules for the same status.
SQL: | SELECT name FROM items AS ikob
WHERE code IN (
SELECT code FROM schedules AS vmob
WHERE vmob.status = ikob.status
); | {
"outer_table": "items",
"inner_table": "schedules",
"outer_alias": "ikob",
"inner_alias": "vmob",
"proj_col": "name",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "ikob.status",
"token_group": "T2",
"fan_out": 60
} | T2 | cs9_fixed_v1_train_00179 | train |
v1 | Schema:
orders (alias: kab)(value, date, name, type)
branches(code, amount, status, date)
Task: Find salary from orders where status appears in branches entries with matching status.
SQL: | SELECT salary FROM orders AS kab
WHERE status IN (
SELECT status FROM branches AS agov
WHERE agov.status = kab.status
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "kab",
"inner_alias": "agov",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "kab.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00180 | train |
v3 | Schema:
customers (alias: lex)(amount, salary, status, level)
managers(name, level, code, id)
Task: Find value from customers where value exceeds the count of amount from managers for the same id.
SQL: | SELECT value FROM customers AS lex
WHERE value > (
SELECT COUNT(amount) FROM managers AS hac
WHERE hac.id = lex.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "lex",
"inner_alias": "hac",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "lex.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00181 | train |
v1 | Schema:
customers (alias: lex)(status, type, code, value)
items(date, id, code, value)
Task: Find value from customers where id appears in items entries with matching level.
SQL: | SELECT value FROM customers AS lex
WHERE id IN (
SELECT id FROM items AS ikob
WHERE ikob.level = lex.level
); | {
"outer_table": "customers",
"inner_table": "items",
"outer_alias": "lex",
"inner_alias": "ikob",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "lex.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00182 | train |
v2 | Schema:
sales (alias: cif)(level, date, salary, status)
tasks(amount, level, code, name)
Task: Find id from sales where a matching record exists in tasks with the same code.
SQL: | SELECT id FROM sales AS cif
WHERE EXISTS (
SELECT 1 FROM tasks AS znob
WHERE znob.code = cif.code
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "cif",
"inner_alias": "znob",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "cif.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00183 | train |
v1 | Schema:
sales (alias: cif)(level, date, salary, value)
regions(level, type, date, value)
Task: Retrieve amount from sales whose id is found in regions rows where code matches the outer record.
SQL: | SELECT amount FROM sales AS cif
WHERE id IN (
SELECT id FROM regions AS okiv
WHERE okiv.code = cif.code
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "cif",
"inner_alias": "okiv",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cif.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00184 | train |
v1 | Schema:
regions (alias: okiv)(date, type, level, name)
customers(date, amount, salary, type)
Task: Find amount from regions where code appears in customers entries with matching level.
SQL: | SELECT amount FROM regions AS okiv
WHERE code IN (
SELECT code FROM customers AS lex
WHERE lex.level = okiv.level
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "okiv",
"inner_alias": "lex",
"proj_col": "amount",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "okiv.level",
"token_group": "T2",
"fan_out": 55
} | T2 | cs9_fixed_v1_train_00185 | train |
v2 | Schema:
accounts (alias: jac)(level, name, salary, value)
sales(id, level, name, code)
Task: Retrieve id from accounts that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT id FROM accounts AS jac
WHERE EXISTS (
SELECT 1 FROM sales AS cif
WHERE cif.status = jac.status
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "jac",
"inner_alias": "cif",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "jac.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00186 | train |
v3 | Schema:
branches (alias: agov)(name, value, salary, level)
customers(id, date, salary, type)
Task: Find name from branches where amount exceeds the maximum amount from customers for the same id.
SQL: | SELECT name FROM branches AS agov
WHERE amount > (
SELECT MAX(amount) FROM customers AS lex
WHERE lex.id = agov.id
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "agov",
"inner_alias": "lex",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "agov.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs9_fixed_v1_train_00187 | train |
v1 | Schema:
managers (alias: hac)(type, date, status, level)
categories(amount, level, value, name)
Task: Select salary from managers where level exists in categories for the same code.
SQL: | SELECT salary FROM managers AS hac
WHERE level IN (
SELECT level FROM categories AS egiv
WHERE egiv.code = hac.code
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "hac",
"inner_alias": "egiv",
"proj_col": "salary",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "hac.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00188 | train |
v3 | Schema:
sales (alias: cif)(salary, value, status, type)
regions(code, name, id, status)
Task: Find id from sales where amount exceeds the average salary from regions for the same type.
SQL: | SELECT id FROM sales AS cif
WHERE amount > (
SELECT AVG(salary) FROM regions AS okiv
WHERE okiv.type = cif.type
); | {
"outer_table": "sales",
"inner_table": "regions",
"outer_alias": "cif",
"inner_alias": "okiv",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "cif.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00189 | train |
v1 | Schema:
employees (alias: bev)(type, amount, name, date)
tasks(code, amount, status, id)
Task: Retrieve value from employees whose status is found in tasks rows where code matches the outer record.
SQL: | SELECT value FROM employees AS bev
WHERE status IN (
SELECT status FROM tasks AS znob
WHERE znob.code = bev.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "bev",
"inner_alias": "znob",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "bev.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00190 | train |
v1 | Schema:
staff (alias: xnob)(id, amount, salary, name)
categories(id, amount, level, type)
Task: Find id from staff where level appears in categories entries with matching type.
SQL: | SELECT id FROM staff AS xnob
WHERE level IN (
SELECT level FROM categories AS egiv
WHERE egiv.type = xnob.type
); | {
"outer_table": "staff",
"inner_table": "categories",
"outer_alias": "xnob",
"inner_alias": "egiv",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "xnob.type",
"token_group": "T2",
"fan_out": 40
} | T2 | cs9_fixed_v1_train_00191 | train |
v3 | Schema:
employees (alias: bev)(code, level, date, amount)
regions(code, level, value, id)
Task: Retrieve code from employees with value above the SUM(amount) of regions rows sharing the same level.
SQL: | SELECT code FROM employees AS bev
WHERE value > (
SELECT SUM(amount) FROM regions AS okiv
WHERE okiv.level = bev.level
); | {
"outer_table": "employees",
"inner_table": "regions",
"outer_alias": "bev",
"inner_alias": "okiv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "bev.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00192 | train |
v2 | Schema:
products (alias: nad)(value, date, salary, level)
tasks(code, status, salary, date)
Task: Retrieve code from products that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT code FROM products AS nad
WHERE EXISTS (
SELECT 1 FROM tasks AS znob
WHERE znob.id = nad.id
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "nad",
"inner_alias": "znob",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "nad.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00193 | train |
v1 | Schema:
shipments (alias: vnob)(date, status, name, code)
accounts(status, type, code, amount)
Task: Retrieve id from shipments whose status is found in accounts rows where code matches the outer record.
SQL: | SELECT id FROM shipments AS vnob
WHERE status IN (
SELECT status FROM accounts AS jac
WHERE jac.code = vnob.code
); | {
"outer_table": "shipments",
"inner_table": "accounts",
"outer_alias": "vnob",
"inner_alias": "jac",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "vnob.code",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00194 | train |
v1 | Schema:
managers (alias: hac)(date, type, level, status)
products(value, date, amount, code)
Task: Select id from managers where id exists in products for the same id.
SQL: | SELECT id FROM managers AS hac
WHERE id IN (
SELECT id FROM products AS nad
WHERE nad.id = hac.id
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "hac",
"inner_alias": "nad",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "hac.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00195 | train |
v1 | Schema:
accounts (alias: jac)(amount, salary, date, name)
items(id, level, status, type)
Task: Find salary from accounts where level appears in items entries with matching id.
SQL: | SELECT salary FROM accounts AS jac
WHERE level IN (
SELECT level FROM items AS ikob
WHERE ikob.id = jac.id
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "jac",
"inner_alias": "ikob",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "jac.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00196 | train |
v3 | Schema:
shipments (alias: vnob)(name, date, code, amount)
staff(name, status, salary, id)
Task: Retrieve salary from shipments with salary above the MAX(value) of staff rows sharing the same code.
SQL: | SELECT salary FROM shipments AS vnob
WHERE salary > (
SELECT MAX(value) FROM staff AS xnob
WHERE xnob.code = vnob.code
); | {
"outer_table": "shipments",
"inner_table": "staff",
"outer_alias": "vnob",
"inner_alias": "xnob",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "vnob.code",
"token_group": "T2",
"fan_out": 45
} | T2 | cs9_fixed_v1_train_00197 | train |
v1 | Schema:
employees (alias: bev)(amount, salary, status, name)
categories(salary, type, level, amount)
Task: Find amount from employees where status appears in categories entries with matching status.
SQL: | SELECT amount FROM employees AS bev
WHERE status IN (
SELECT status FROM categories AS egiv
WHERE egiv.status = bev.status
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "bev",
"inner_alias": "egiv",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "bev.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs9_fixed_v1_train_00198 | train |
v3 | Schema:
requests (alias: ejof)(amount, date, level, salary)
schedules(level, value, date, id)
Task: Retrieve code from requests with value above the MIN(value) of schedules rows sharing the same code.
SQL: | SELECT code FROM requests AS ejof
WHERE value > (
SELECT MIN(value) FROM schedules AS vmob
WHERE vmob.code = ejof.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ejof",
"inner_alias": "vmob",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ejof.code",
"token_group": "T2",
"fan_out": 70
} | T2 | cs9_fixed_v1_train_00199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.