variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v2 | Schema:
invoices (alias: inv)(name, level, date, amount)
sales(id, value, salary, code)
Task: Retrieve salary from invoices that have at least one corresponding entry in sales sharing the same code.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10300 | train |
v2 | Schema:
regions (alias: rgn)(status, salary, name, amount)
customers(status, amount, date, value)
Task: Retrieve value from regions that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10301 | train |
v3 | Schema:
customers (alias: cust)(salary, id, code, level)
managers(type, level, name, amount)
Task: Find value from customers where amount exceeds the total salary from managers for the same id.
SQL: | SELECT value FROM customers AS cust
WHERE amount > (
SELECT SUM(salary) FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10302 | train |
v3 | Schema:
shipments (alias: shp)(amount, id, type, salary)
transactions(amount, id, value, name)
Task: Retrieve id from shipments with salary above the MAX(amount) of transactions rows sharing the same code.
SQL: | SELECT id FROM shipments AS shp
WHERE salary > (
SELECT MAX(amount) FROM transactions AS txn
WHERE txn.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10303 | train |
v1 | Schema:
shipments (alias: shp)(salary, code, name, type)
employees(date, status, amount, salary)
Task: Retrieve code from shipments whose status is found in employees rows where code matches the outer record.
SQL: | SELECT code FROM shipments AS shp
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10304 | train |
v1 | Schema:
tasks (alias: tsk)(amount, id, name, salary)
transactions(id, salary, date, amount)
Task: Find code from tasks where id appears in transactions entries with matching code.
SQL: | SELECT code FROM tasks AS tsk
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10305 | train |
v1 | Schema:
staff (alias: empl)(amount, salary, value, id)
tasks(value, type, level, name)
Task: Select id from staff where code exists in tasks for the same level.
SQL: | SELECT id FROM staff AS empl
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10306 | train |
v2 | Schema:
invoices (alias: inv)(status, level, id, type)
transactions(salary, status, type, value)
Task: Retrieve code from invoices that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT code FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10307 | train |
v3 | Schema:
employees (alias: emp)(amount, date, value, level)
projects(level, name, id, date)
Task: Retrieve name from employees with salary above the COUNT(salary) of projects rows sharing the same id.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT COUNT(salary) FROM projects AS prj
WHERE prj.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10308 | train |
v2 | Schema:
requests (alias: ordr)(amount, id, status, date)
projects(value, name, status, amount)
Task: Find value from requests where a matching record exists in projects with the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10309 | train |
v3 | Schema:
projects (alias: prj)(date, level, amount, code)
staff(amount, salary, code, type)
Task: Find amount from projects where salary exceeds the total amount from staff for the same status.
SQL: | SELECT amount FROM projects AS prj
WHERE salary > (
SELECT SUM(amount) FROM staff AS empl
WHERE empl.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "staff",
"outer_alias": "prj",
"inner_alias": "empl",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10310 | train |
v2 | Schema:
regions (alias: rgn)(date, name, code, salary)
accounts(date, type, value, id)
Task: Retrieve name from regions that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10311 | train |
v1 | Schema:
managers (alias: mgr)(id, name, salary, date)
items(type, status, amount, name)
Task: Retrieve salary from managers whose level is found in items rows where type matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10312 | train |
v3 | Schema:
shipments (alias: shp)(name, salary, value, level)
customers(level, amount, date, id)
Task: Retrieve name from shipments with value above the COUNT(salary) of customers rows sharing the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE value > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10313 | train |
v3 | Schema:
orders (alias: ord)(id, amount, name, type)
projects(type, id, value, salary)
Task: Retrieve name from orders with salary above the COUNT(value) of projects rows sharing the same code.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT COUNT(value) FROM projects AS prj
WHERE prj.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10314 | train |
v2 | Schema:
schedules (alias: schd)(salary, type, value, id)
products(name, level, value, amount)
Task: Retrieve code from schedules that have at least one corresponding entry in products sharing the same status.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "products",
"outer_alias": "schd",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10315 | train |
v2 | Schema:
regions (alias: rgn)(type, amount, value, code)
transactions(amount, salary, level, date)
Task: Retrieve id from regions that have at least one corresponding entry in transactions sharing the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10316 | train |
v2 | Schema:
requests (alias: ordr)(type, status, level, code)
tasks(status, id, type, salary)
Task: Find name from requests where a matching record exists in tasks with the same code.
SQL: | SELECT name FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10317 | train |
v2 | Schema:
orders (alias: ord)(salary, level, amount, id)
departments(date, type, level, value)
Task: Retrieve id from orders that have at least one corresponding entry in departments sharing the same level.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "departments",
"outer_alias": "ord",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10318 | train |
v3 | Schema:
transactions (alias: txn)(type, amount, id, value)
sales(type, value, date, salary)
Task: Find name from transactions where value exceeds the count of amount from sales for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT COUNT(amount) FROM sales AS sale
WHERE sale.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10319 | train |
v3 | Schema:
shipments (alias: shp)(level, value, type, status)
projects(id, level, salary, status)
Task: Find value from shipments where value exceeds the maximum salary from projects for the same code.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT MAX(salary) FROM projects AS prj
WHERE prj.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10320 | train |
v3 | Schema:
branches (alias: brc)(date, code, type, status)
categories(level, id, code, status)
Task: Retrieve name from branches with salary above the AVG(value) of categories rows sharing the same level.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10321 | train |
v1 | Schema:
shipments (alias: shp)(name, value, date, code)
managers(amount, date, id, type)
Task: Select id from shipments where status exists in managers for the same type.
SQL: | SELECT id FROM shipments AS shp
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10322 | train |
v3 | Schema:
projects (alias: prj)(type, salary, id, level)
products(name, status, value, type)
Task: Find salary from projects where amount exceeds the average salary from products for the same type.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT AVG(salary) FROM products AS prod
WHERE prod.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10323 | train |
v2 | Schema:
sales (alias: sale)(level, id, code, amount)
shipments(salary, value, level, name)
Task: Find salary from sales where a matching record exists in shipments with the same status.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10324 | train |
v2 | Schema:
projects (alias: prj)(id, salary, type, value)
invoices(type, name, status, salary)
Task: Find code from projects where a matching record exists in invoices with the same code.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10325 | train |
v3 | Schema:
departments (alias: dept)(salary, type, amount, code)
requests(value, type, name, date)
Task: Find value from departments where salary exceeds the average value from requests for the same id.
SQL: | SELECT value FROM departments AS dept
WHERE salary > (
SELECT AVG(value) FROM requests AS ordr
WHERE ordr.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10326 | train |
v1 | Schema:
products (alias: prod)(date, value, status, amount)
invoices(value, salary, code, id)
Task: Select name from products where id exists in invoices for the same type.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM invoices AS inv
WHERE inv.type = prod.type
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10327 | train |
v1 | Schema:
orders (alias: ord)(level, value, name, id)
products(code, date, type, status)
Task: Select value from orders where code exists in products for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "products",
"outer_alias": "ord",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10328 | train |
v2 | Schema:
employees (alias: emp)(id, value, amount, status)
tasks(name, code, date, id)
Task: Find value from employees where a matching record exists in tasks with the same status.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10329 | train |
v3 | Schema:
branches (alias: brc)(date, name, id, value)
items(date, amount, salary, value)
Task: Retrieve id from branches with value above the AVG(value) of items rows sharing the same type.
SQL: | SELECT id FROM branches AS brc
WHERE value > (
SELECT AVG(value) FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10330 | train |
v3 | Schema:
staff (alias: empl)(type, amount, date, value)
projects(value, id, level, amount)
Task: Retrieve id from staff with value above the AVG(value) of projects rows sharing the same id.
SQL: | SELECT id FROM staff AS empl
WHERE value > (
SELECT AVG(value) FROM projects AS prj
WHERE prj.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "projects",
"outer_alias": "empl",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10331 | train |
v2 | Schema:
regions (alias: rgn)(salary, level, type, amount)
items(amount, date, value, id)
Task: Retrieve salary from regions that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10332 | train |
v3 | Schema:
branches (alias: brc)(type, status, code, id)
requests(salary, status, value, type)
Task: Retrieve id from branches with amount above the AVG(amount) of requests rows sharing the same type.
SQL: | SELECT id FROM branches AS brc
WHERE amount > (
SELECT AVG(amount) FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_10333 | train |
v3 | Schema:
projects (alias: prj)(status, salary, id, amount)
schedules(date, status, code, name)
Task: Find salary from projects where salary exceeds the maximum value from schedules for the same status.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "schedules",
"outer_alias": "prj",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10334 | train |
v1 | Schema:
orders (alias: ord)(salary, date, status, level)
regions(amount, id, date, value)
Task: Retrieve value from orders whose status is found in regions rows where status matches the outer record.
SQL: | SELECT value FROM orders AS ord
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10335 | train |
v3 | Schema:
regions (alias: rgn)(salary, value, status, date)
invoices(name, salary, id, status)
Task: Retrieve salary from regions with amount above the SUM(value) of invoices rows sharing the same level.
SQL: | SELECT salary FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10336 | train |
v2 | Schema:
orders (alias: ord)(date, code, value, type)
items(salary, type, status, code)
Task: Find value from orders where a matching record exists in items with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "items",
"outer_alias": "ord",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10337 | train |
v3 | Schema:
schedules (alias: schd)(salary, level, name, code)
orders(code, amount, status, date)
Task: Find salary from schedules where value exceeds the count of amount from orders for the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE value > (
SELECT COUNT(amount) FROM orders AS ord
WHERE ord.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10338 | train |
v3 | Schema:
orders (alias: ord)(value, name, status, date)
regions(date, id, name, code)
Task: Find id from orders where value exceeds the minimum amount from regions for the same id.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10339 | train |
v2 | Schema:
orders (alias: ord)(id, code, amount, date)
customers(date, status, salary, type)
Task: Find name from orders where a matching record exists in customers with the same code.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10340 | train |
v1 | Schema:
projects (alias: prj)(salary, amount, id, status)
customers(level, value, date, amount)
Task: Retrieve amount from projects whose type is found in customers rows where level matches the outer record.
SQL: | SELECT amount FROM projects AS prj
WHERE type IN (
SELECT type FROM customers AS cust
WHERE cust.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_10341 | train |
v2 | Schema:
managers (alias: mgr)(salary, code, id, name)
departments(value, amount, status, type)
Task: Retrieve value from managers that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10342 | train |
v3 | Schema:
categories (alias: catg)(name, level, value, id)
products(status, type, amount, id)
Task: Retrieve salary from categories with salary above the COUNT(salary) of products rows sharing the same level.
SQL: | SELECT salary FROM categories AS catg
WHERE salary > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10343 | train |
v2 | Schema:
products (alias: prod)(amount, name, date, salary)
projects(code, date, status, value)
Task: Find value from products where a matching record exists in projects with the same level.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = prod.level
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10344 | train |
v1 | Schema:
departments (alias: dept)(salary, date, type, value)
projects(status, code, type, date)
Task: Find name from departments where status appears in projects entries with matching status.
SQL: | SELECT name FROM departments AS dept
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10345 | train |
v3 | Schema:
schedules (alias: schd)(status, date, value, salary)
categories(name, date, salary, level)
Task: Find id from schedules where amount exceeds the total amount from categories for the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10346 | train |
v2 | Schema:
regions (alias: rgn)(name, date, level, type)
transactions(name, level, id, salary)
Task: Retrieve id from regions that have at least one corresponding entry in transactions sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "transactions",
"outer_alias": "rgn",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10347 | train |
v1 | Schema:
regions (alias: rgn)(id, value, type, status)
branches(status, value, level, id)
Task: Find value from regions where code appears in branches entries with matching status.
SQL: | SELECT value FROM regions AS rgn
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10348 | train |
v1 | Schema:
items (alias: lne)(value, date, amount, status)
categories(date, salary, value, level)
Task: Select name from items where status exists in categories for the same code.
SQL: | SELECT name FROM items AS lne
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.code = lne.code
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10349 | train |
v2 | Schema:
requests (alias: ordr)(value, type, code, date)
schedules(code, status, name, level)
Task: Retrieve value from requests that have at least one corresponding entry in schedules sharing the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10350 | train |
v2 | Schema:
regions (alias: rgn)(value, status, salary, amount)
invoices(salary, date, code, amount)
Task: Find id from regions where a matching record exists in invoices with the same id.
SQL: | SELECT id FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "invoices",
"outer_alias": "rgn",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10351 | train |
v1 | Schema:
customers (alias: cust)(code, salary, type, level)
accounts(salary, type, code, name)
Task: Find id from customers where status appears in accounts entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE status IN (
SELECT status FROM accounts AS acct
WHERE acct.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10352 | train |
v1 | Schema:
staff (alias: empl)(value, salary, code, id)
products(salary, date, value, code)
Task: Find salary from staff where code appears in products entries with matching code.
SQL: | SELECT salary FROM staff AS empl
WHERE code IN (
SELECT code FROM products AS prod
WHERE prod.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10353 | train |
v3 | Schema:
accounts (alias: acct)(level, value, amount, type)
regions(name, id, type, amount)
Task: Retrieve amount from accounts with value above the SUM(value) of regions rows sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE value > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10354 | train |
v3 | Schema:
requests (alias: ordr)(salary, level, id, value)
accounts(status, type, value, level)
Task: Retrieve id from requests with salary above the AVG(amount) of accounts rows sharing the same type.
SQL: | SELECT id FROM requests AS ordr
WHERE salary > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10355 | train |
v3 | Schema:
tasks (alias: tsk)(value, date, amount, salary)
shipments(name, id, salary, type)
Task: Retrieve salary from tasks with value above the COUNT(amount) of shipments rows sharing the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE value > (
SELECT COUNT(amount) FROM shipments AS shp
WHERE shp.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10356 | train |
v2 | Schema:
categories (alias: catg)(name, id, type, code)
employees(value, date, status, name)
Task: Retrieve id from categories that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10357 | train |
v2 | Schema:
departments (alias: dept)(level, name, id, status)
regions(value, date, amount, name)
Task: Find id from departments where a matching record exists in regions with the same code.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "regions",
"outer_alias": "dept",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10358 | train |
v2 | Schema:
tasks (alias: tsk)(date, code, status, id)
sales(value, status, date, type)
Task: Find id from tasks where a matching record exists in sales with the same code.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10359 | train |
v2 | Schema:
regions (alias: rgn)(id, date, code, salary)
projects(salary, name, type, status)
Task: Retrieve code from regions that have at least one corresponding entry in projects sharing the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "projects",
"outer_alias": "rgn",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10360 | train |
v1 | Schema:
categories (alias: catg)(status, date, code, salary)
staff(type, value, status, id)
Task: Retrieve value from categories whose id is found in staff rows where type matches the outer record.
SQL: | SELECT value FROM categories AS catg
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10361 | train |
v3 | Schema:
departments (alias: dept)(id, status, name, amount)
invoices(date, name, value, level)
Task: Retrieve salary from departments with amount above the MAX(salary) of invoices rows sharing the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT MAX(salary) FROM invoices AS inv
WHERE inv.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10362 | train |
v2 | Schema:
managers (alias: mgr)(value, status, code, id)
invoices(value, type, status, name)
Task: Retrieve code from managers that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10363 | train |
v2 | Schema:
accounts (alias: acct)(status, level, salary, name)
items(level, salary, value, id)
Task: Find code from accounts where a matching record exists in items with the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10364 | train |
v1 | Schema:
shipments (alias: shp)(status, value, name, date)
projects(status, value, date, level)
Task: Find amount from shipments where id appears in projects entries with matching type.
SQL: | SELECT amount FROM shipments AS shp
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10365 | train |
v1 | Schema:
requests (alias: ordr)(date, salary, id, name)
orders(name, salary, status, level)
Task: Retrieve value from requests whose status is found in orders rows where status matches the outer record.
SQL: | SELECT value FROM requests AS ordr
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "orders",
"outer_alias": "ordr",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10366 | train |
v3 | Schema:
accounts (alias: acct)(id, code, date, amount)
managers(salary, status, value, code)
Task: Find name from accounts where salary exceeds the average value from managers for the same status.
SQL: | SELECT name FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM managers AS mgr
WHERE mgr.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10367 | train |
v2 | Schema:
shipments (alias: shp)(date, level, salary, name)
categories(status, value, id, date)
Task: Find id from shipments where a matching record exists in categories with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10368 | train |
v1 | Schema:
categories (alias: catg)(amount, name, salary, value)
items(amount, id, status, level)
Task: Retrieve salary from categories whose type is found in items rows where status matches the outer record.
SQL: | SELECT salary FROM categories AS catg
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10369 | train |
v2 | Schema:
schedules (alias: schd)(date, type, name, level)
requests(type, value, id, level)
Task: Retrieve code from schedules that have at least one corresponding entry in requests sharing the same id.
SQL: | SELECT code FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10370 | train |
v2 | Schema:
sales (alias: sale)(value, type, level, name)
invoices(type, date, salary, name)
Task: Find id from sales where a matching record exists in invoices with the same type.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "invoices",
"outer_alias": "sale",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10371 | train |
v3 | Schema:
departments (alias: dept)(name, amount, type, date)
transactions(amount, date, name, level)
Task: Find code from departments where value exceeds the average amount from transactions for the same id.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT AVG(amount) FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10372 | train |
v3 | Schema:
accounts (alias: acct)(id, amount, level, salary)
regions(status, type, level, name)
Task: Find name from accounts where amount exceeds the minimum value from regions for the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE amount > (
SELECT MIN(value) FROM regions AS rgn
WHERE rgn.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10373 | train |
v2 | Schema:
tasks (alias: tsk)(id, salary, value, level)
shipments(date, value, status, level)
Task: Find name from tasks where a matching record exists in shipments with the same status.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "shipments",
"outer_alias": "tsk",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10374 | train |
v1 | Schema:
orders (alias: ord)(amount, level, name, id)
regions(name, status, level, amount)
Task: Retrieve name from orders whose status is found in regions rows where level matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM regions AS rgn
WHERE rgn.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10375 | train |
v3 | Schema:
shipments (alias: shp)(status, salary, code, amount)
products(id, amount, date, name)
Task: Find salary from shipments where amount exceeds the total value from products for the same type.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT SUM(value) FROM products AS prod
WHERE prod.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10376 | train |
v2 | Schema:
categories (alias: catg)(code, amount, type, value)
sales(id, date, status, level)
Task: Retrieve amount from categories that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_10377 | train |
v2 | Schema:
managers (alias: mgr)(amount, type, level, code)
shipments(status, date, level, name)
Task: Find id from managers where a matching record exists in shipments with the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10378 | train |
v2 | Schema:
products (alias: prod)(id, amount, level, code)
invoices(level, amount, code, status)
Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = prod.status
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10379 | train |
v2 | Schema:
shipments (alias: shp)(status, salary, date, value)
managers(amount, code, level, status)
Task: Retrieve code from shipments that have at least one corresponding entry in managers sharing the same level.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_10380 | train |
v2 | Schema:
departments (alias: dept)(type, status, amount, date)
projects(status, id, value, code)
Task: Find salary from departments where a matching record exists in projects with the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10381 | train |
v1 | Schema:
products (alias: prod)(salary, amount, name, status)
employees(code, status, name, date)
Task: Retrieve amount from products whose code is found in employees rows where status matches the outer record.
SQL: | SELECT amount FROM products AS prod
WHERE code IN (
SELECT code FROM employees AS emp
WHERE emp.status = prod.status
); | {
"outer_table": "products",
"inner_table": "employees",
"outer_alias": "prod",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10382 | train |
v2 | Schema:
staff (alias: empl)(date, type, value, level)
departments(type, code, value, salary)
Task: Retrieve amount from staff that have at least one corresponding entry in departments sharing the same status.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = empl.status
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "empl.status",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10383 | train |
v2 | Schema:
items (alias: lne)(code, value, id, level)
invoices(name, value, date, level)
Task: Find amount from items where a matching record exists in invoices with the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = lne.id
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10384 | train |
v1 | Schema:
invoices (alias: inv)(id, status, level, type)
categories(amount, type, status, date)
Task: Select id from invoices where id exists in categories for the same code.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10385 | train |
v2 | Schema:
items (alias: lne)(type, level, name, date)
customers(amount, salary, status, id)
Task: Retrieve amount from items that have at least one corresponding entry in customers sharing the same id.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = lne.id
); | {
"outer_table": "items",
"inner_table": "customers",
"outer_alias": "lne",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10386 | train |
v2 | Schema:
managers (alias: mgr)(type, name, date, status)
accounts(status, level, date, name)
Task: Find name from managers where a matching record exists in accounts with the same type.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "accounts",
"outer_alias": "mgr",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10387 | train |
v2 | Schema:
items (alias: lne)(value, id, name, salary)
shipments(code, salary, level, name)
Task: Find code from items where a matching record exists in shipments with the same level.
SQL: | SELECT code FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = lne.level
); | {
"outer_table": "items",
"inner_table": "shipments",
"outer_alias": "lne",
"inner_alias": "shp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10388 | train |
v2 | Schema:
items (alias: lne)(salary, code, amount, level)
managers(value, salary, level, date)
Task: Find amount from items where a matching record exists in managers with the same code.
SQL: | SELECT amount FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = lne.code
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_10389 | train |
v2 | Schema:
staff (alias: empl)(id, level, amount, salary)
products(amount, value, status, code)
Task: Retrieve amount from staff that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "products",
"outer_alias": "empl",
"inner_alias": "prod",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10390 | train |
v3 | Schema:
sales (alias: sale)(value, status, salary, amount)
staff(date, type, status, code)
Task: Retrieve salary from sales with amount above the AVG(salary) of staff rows sharing the same id.
SQL: | SELECT salary FROM sales AS sale
WHERE amount > (
SELECT AVG(salary) FROM staff AS empl
WHERE empl.id = sale.id
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "sale.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10391 | train |
v1 | Schema:
invoices (alias: inv)(code, status, type, id)
branches(code, date, amount, value)
Task: Retrieve value from invoices whose level is found in branches rows where status matches the outer record.
SQL: | SELECT value FROM invoices AS inv
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10392 | train |
v2 | Schema:
staff (alias: empl)(status, date, code, amount)
regions(date, type, code, value)
Task: Retrieve amount from staff that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_10393 | train |
v3 | Schema:
products (alias: prod)(code, date, name, amount)
tasks(amount, level, date, type)
Task: Retrieve name from products with salary above the MAX(salary) of tasks rows sharing the same type.
SQL: | SELECT name FROM products AS prod
WHERE salary > (
SELECT MAX(salary) FROM tasks AS tsk
WHERE tsk.type = prod.type
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10394 | train |
v3 | Schema:
requests (alias: ordr)(salary, value, amount, id)
branches(date, level, code, name)
Task: Retrieve value from requests with value above the SUM(amount) of branches rows sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE value > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_10395 | train |
v2 | Schema:
invoices (alias: inv)(type, id, name, status)
regions(type, id, code, date)
Task: Find salary from invoices where a matching record exists in regions with the same id.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10396 | train |
v3 | Schema:
sales (alias: sale)(status, value, code, id)
accounts(value, id, code, status)
Task: Find id from sales where salary exceeds the total value from accounts for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE salary > (
SELECT SUM(value) FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_10397 | train |
v1 | Schema:
regions (alias: rgn)(status, value, code, id)
items(date, name, level, value)
Task: Retrieve value from regions whose status is found in items rows where id matches the outer record.
SQL: | SELECT value FROM regions AS rgn
WHERE status IN (
SELECT status FROM items AS lne
WHERE lne.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_10398 | train |
v2 | Schema:
tasks (alias: tsk)(level, status, amount, code)
products(amount, code, salary, level)
Task: Retrieve name from tasks that have at least one corresponding entry in products sharing the same level.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "products",
"outer_alias": "tsk",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_10399 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.