variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v1 | Schema:
branches (alias: brc)(code, name, level, status)
requests(date, status, id, level)
Task: Find amount from branches where code appears in requests entries with matching id.
SQL: | SELECT amount FROM branches AS brc
WHERE code IN (
SELECT code FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00700 | train |
v2 | Schema:
schedules (alias: schd)(value, type, amount, salary)
branches(id, amount, name, status)
Task: Find id from schedules where a matching record exists in branches with the same id.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00701 | train |
v2 | Schema:
requests (alias: ordr)(date, level, code, type)
accounts(level, type, status, amount)
Task: Find amount from requests where a matching record exists in accounts with the same id.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00702 | train |
v2 | Schema:
shipments (alias: shp)(amount, salary, date, level)
sales(name, code, amount, level)
Task: Retrieve value from shipments that have at least one corresponding entry in sales sharing the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "sales",
"outer_alias": "shp",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00703 | train |
v1 | Schema:
invoices (alias: inv)(code, name, id, status)
projects(status, amount, name, level)
Task: Select amount from invoices where level exists in projects for the same code.
SQL: | SELECT amount FROM invoices AS inv
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00704 | train |
v1 | Schema:
sales (alias: sale)(amount, type, id, status)
departments(value, level, name, date)
Task: Select salary from sales where level exists in departments for the same type.
SQL: | SELECT salary FROM sales AS sale
WHERE level IN (
SELECT level FROM departments AS dept
WHERE dept.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "departments",
"outer_alias": "sale",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00705 | train |
v3 | Schema:
orders (alias: ord)(name, code, type, date)
schedules(salary, level, id, status)
Task: Find salary from orders where value exceeds the maximum value from schedules for the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00706 | train |
v1 | Schema:
customers (alias: cust)(code, id, type, salary)
requests(level, amount, status, value)
Task: Find id from customers where type appears in requests entries with matching type.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM requests AS ordr
WHERE ordr.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "requests",
"outer_alias": "cust",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00707 | train |
v3 | Schema:
transactions (alias: txn)(type, name, date, value)
branches(status, amount, name, salary)
Task: Find value from transactions where salary exceeds the total value from branches for the same id.
SQL: | SELECT value FROM transactions AS txn
WHERE salary > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "branches",
"outer_alias": "txn",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00708 | train |
v3 | Schema:
regions (alias: rgn)(amount, date, type, id)
requests(name, date, level, code)
Task: Find salary from regions where salary exceeds the count of amount from requests for the same type.
SQL: | SELECT salary FROM regions AS rgn
WHERE salary > (
SELECT COUNT(amount) FROM requests AS ordr
WHERE ordr.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "requests",
"outer_alias": "rgn",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00709 | train |
v3 | Schema:
accounts (alias: acct)(date, code, status, amount)
customers(id, value, name, level)
Task: Retrieve code from accounts with value above the COUNT(salary) of customers rows sharing the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00710 | train |
v3 | Schema:
requests (alias: ordr)(name, value, type, status)
projects(type, code, date, value)
Task: Retrieve amount from requests with amount above the SUM(amount) of projects rows sharing the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE amount > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00711 | train |
v2 | Schema:
regions (alias: rgn)(value, amount, id, date)
staff(value, date, type, id)
Task: Find value from regions where a matching record exists in staff with the same code.
SQL: | SELECT value FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "staff",
"outer_alias": "rgn",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00712 | train |
v3 | Schema:
items (alias: lne)(code, amount, value, id)
regions(code, level, type, amount)
Task: Retrieve salary from items with salary above the AVG(salary) of regions rows sharing the same status.
SQL: | SELECT salary FROM items AS lne
WHERE salary > (
SELECT AVG(salary) FROM regions AS rgn
WHERE rgn.status = lne.status
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00713 | train |
v3 | Schema:
sales (alias: sale)(date, level, name, code)
schedules(status, amount, type, salary)
Task: Find amount from sales where salary exceeds the maximum value from schedules for the same status.
SQL: | SELECT amount FROM sales AS sale
WHERE salary > (
SELECT MAX(value) FROM schedules AS schd
WHERE schd.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "schedules",
"outer_alias": "sale",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00714 | train |
v2 | Schema:
categories (alias: catg)(type, salary, level, amount)
employees(id, status, salary, level)
Task: Find code from categories where a matching record exists in employees with the same id.
SQL: | SELECT code FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00715 | train |
v1 | Schema:
transactions (alias: txn)(code, name, salary, type)
staff(name, value, status, level)
Task: Select code from transactions where type exists in staff for the same level.
SQL: | SELECT code FROM transactions AS txn
WHERE type IN (
SELECT type FROM staff AS empl
WHERE empl.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "staff",
"outer_alias": "txn",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00716 | train |
v3 | Schema:
items (alias: lne)(level, value, salary, date)
regions(id, name, value, status)
Task: Find value from items where value exceeds the minimum salary from regions for the same level.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.level = lne.level
); | {
"outer_table": "items",
"inner_table": "regions",
"outer_alias": "lne",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00717 | train |
v3 | Schema:
invoices (alias: inv)(salary, code, amount, level)
sales(type, code, value, name)
Task: Find id from invoices where amount exceeds the maximum value from sales for the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT MAX(value) FROM sales AS sale
WHERE sale.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "sales",
"outer_alias": "inv",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00718 | train |
v3 | Schema:
branches (alias: brc)(amount, salary, id, name)
orders(date, value, name, salary)
Task: Find code from branches where amount exceeds the minimum salary from orders for the same status.
SQL: | SELECT code FROM branches AS brc
WHERE amount > (
SELECT MIN(salary) FROM orders AS ord
WHERE ord.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "orders",
"outer_alias": "brc",
"inner_alias": "ord",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00719 | train |
v3 | Schema:
invoices (alias: inv)(date, value, code, level)
staff(value, status, amount, name)
Task: Find salary from invoices where salary exceeds the average value from staff for the same status.
SQL: | SELECT salary FROM invoices AS inv
WHERE salary > (
SELECT AVG(value) FROM staff AS empl
WHERE empl.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00720 | train |
v3 | Schema:
orders (alias: ord)(name, date, value, status)
regions(amount, name, salary, code)
Task: Find name from orders where salary exceeds the minimum salary from regions for the same id.
SQL: | SELECT name FROM orders AS ord
WHERE salary > (
SELECT MIN(salary) FROM regions AS rgn
WHERE rgn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00721 | train |
v3 | Schema:
managers (alias: mgr)(amount, value, date, name)
regions(amount, salary, value, status)
Task: Find id from managers where salary exceeds the maximum amount from regions for the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE salary > (
SELECT MAX(amount) FROM regions AS rgn
WHERE rgn.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00722 | train |
v1 | Schema:
requests (alias: ordr)(type, name, date, value)
accounts(level, status, name, value)
Task: Find id from requests where level appears in accounts entries with matching id.
SQL: | SELECT id FROM requests AS ordr
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00723 | train |
v2 | Schema:
orders (alias: ord)(date, salary, name, status)
employees(id, date, level, name)
Task: Retrieve id from orders that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "employees",
"outer_alias": "ord",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00724 | train |
v1 | Schema:
customers (alias: cust)(status, amount, type, date)
products(date, id, value, status)
Task: Find code from customers where status appears in products entries with matching id.
SQL: | SELECT code FROM customers AS cust
WHERE status IN (
SELECT status FROM products AS prod
WHERE prod.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00725 | train |
v3 | Schema:
sales (alias: sale)(amount, code, date, value)
shipments(id, name, status, date)
Task: Find amount from sales where amount exceeds the total value from shipments for the same code.
SQL: | SELECT amount FROM sales AS sale
WHERE amount > (
SELECT SUM(value) FROM shipments AS shp
WHERE shp.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "shipments",
"outer_alias": "sale",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00726 | train |
v2 | Schema:
shipments (alias: shp)(level, name, value, date)
tasks(code, type, amount, level)
Task: Retrieve amount from shipments that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00727 | train |
v2 | Schema:
employees (alias: emp)(level, name, code, value)
transactions(salary, type, status, date)
Task: Find salary from employees where a matching record exists in transactions with the same status.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "transactions",
"outer_alias": "emp",
"inner_alias": "txn",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00728 | train |
v2 | Schema:
transactions (alias: txn)(date, value, salary, level)
sales(type, status, level, salary)
Task: Find value from transactions where a matching record exists in sales with the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00729 | train |
v1 | Schema:
shipments (alias: shp)(date, value, amount, level)
schedules(id, salary, name, code)
Task: Select salary from shipments where status exists in schedules for the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00730 | train |
v1 | Schema:
categories (alias: catg)(name, status, code, date)
managers(salary, date, level, id)
Task: Select id from categories where status exists in managers for the same code.
SQL: | SELECT id FROM categories AS catg
WHERE status IN (
SELECT status FROM managers AS mgr
WHERE mgr.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00731 | train |
v2 | Schema:
tasks (alias: tsk)(status, id, salary, amount)
invoices(value, amount, date, code)
Task: Find name from tasks where a matching record exists in invoices with the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00732 | train |
v3 | Schema:
managers (alias: mgr)(date, salary, amount, level)
orders(status, salary, level, date)
Task: Retrieve salary from managers with value above the SUM(salary) of orders rows sharing the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT SUM(salary) FROM orders AS ord
WHERE ord.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00733 | train |
v1 | Schema:
managers (alias: mgr)(level, value, salary, type)
projects(amount, level, value, status)
Task: Select id from managers where type exists in projects for the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE type IN (
SELECT type FROM projects AS prj
WHERE prj.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00734 | train |
v1 | Schema:
employees (alias: emp)(status, amount, code, salary)
branches(date, amount, salary, value)
Task: Find salary from employees where level appears in branches entries with matching status.
SQL: | SELECT salary FROM employees AS emp
WHERE level IN (
SELECT level FROM branches AS brc
WHERE brc.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00735 | train |
v2 | Schema:
branches (alias: brc)(type, amount, salary, id)
customers(name, date, amount, id)
Task: Find code from branches where a matching record exists in customers with the same code.
SQL: | SELECT code FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00736 | train |
v1 | Schema:
categories (alias: catg)(status, salary, id, type)
projects(name, date, code, amount)
Task: Select amount from categories where level exists in projects for the same level.
SQL: | SELECT amount FROM categories AS catg
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00737 | train |
v3 | Schema:
staff (alias: empl)(value, name, level, type)
items(value, name, level, id)
Task: Find amount from staff where amount exceeds the count of value from items for the same type.
SQL: | SELECT amount FROM staff AS empl
WHERE amount > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.type = empl.type
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "empl.type",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00738 | train |
v2 | Schema:
requests (alias: ordr)(amount, code, name, date)
invoices(status, amount, salary, level)
Task: Find amount from requests where a matching record exists in invoices with the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "invoices",
"outer_alias": "ordr",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00739 | train |
v2 | Schema:
departments (alias: dept)(id, code, status, salary)
sales(status, code, amount, date)
Task: Find salary from departments where a matching record exists in sales with the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00740 | train |
v1 | Schema:
projects (alias: prj)(value, type, name, amount)
invoices(code, status, name, amount)
Task: Retrieve code from projects whose status is found in invoices rows where type matches the outer record.
SQL: | SELECT code FROM projects AS prj
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "invoices",
"outer_alias": "prj",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00741 | train |
v1 | Schema:
tasks (alias: tsk)(code, amount, status, value)
departments(name, date, level, type)
Task: Find code from tasks where type appears in departments entries with matching code.
SQL: | SELECT code FROM tasks AS tsk
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "departments",
"outer_alias": "tsk",
"inner_alias": "dept",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00742 | train |
v3 | Schema:
regions (alias: rgn)(level, amount, code, value)
customers(code, status, name, type)
Task: Find amount from regions where amount exceeds the minimum salary from customers for the same status.
SQL: | SELECT amount FROM regions AS rgn
WHERE amount > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "customers",
"outer_alias": "rgn",
"inner_alias": "cust",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00743 | train |
v1 | Schema:
branches (alias: brc)(date, level, code, salary)
requests(code, id, value, level)
Task: Find amount from branches where status appears in requests entries with matching id.
SQL: | SELECT amount FROM branches AS brc
WHERE status IN (
SELECT status FROM requests AS ordr
WHERE ordr.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00744 | train |
v1 | Schema:
invoices (alias: inv)(level, date, name, id)
tasks(type, date, salary, id)
Task: Retrieve id from invoices whose status is found in tasks rows where level matches the outer record.
SQL: | SELECT id FROM invoices AS inv
WHERE status IN (
SELECT status FROM tasks AS tsk
WHERE tsk.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "tasks",
"outer_alias": "inv",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00745 | train |
v2 | Schema:
customers (alias: cust)(id, status, type, value)
accounts(amount, level, date, type)
Task: Retrieve code from customers that have at least one corresponding entry in accounts sharing the same level.
SQL: | SELECT code FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "accounts",
"outer_alias": "cust",
"inner_alias": "acct",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00746 | train |
v3 | Schema:
products (alias: prod)(code, date, level, type)
orders(level, code, date, value)
Task: Find name from products where value exceeds the maximum amount from orders for the same code.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT MAX(amount) FROM orders AS ord
WHERE ord.code = prod.code
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00747 | train |
v3 | Schema:
branches (alias: brc)(value, amount, status, type)
employees(amount, status, value, id)
Task: Find amount from branches where salary exceeds the minimum value from employees for the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE salary > (
SELECT MIN(value) FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00748 | train |
v1 | Schema:
accounts (alias: acct)(amount, type, salary, level)
regions(id, salary, status, name)
Task: Retrieve id from accounts whose level is found in regions rows where type matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00749 | train |
v2 | Schema:
invoices (alias: inv)(value, amount, level, id)
orders(salary, id, value, status)
Task: Find id from invoices where a matching record exists in orders with the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "orders",
"outer_alias": "inv",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00750 | train |
v2 | Schema:
employees (alias: emp)(status, name, amount, id)
branches(code, amount, id, value)
Task: Find value from employees where a matching record exists in branches with the same type.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00751 | train |
v3 | Schema:
branches (alias: brc)(value, amount, date, type)
items(salary, level, id, name)
Task: Find amount from branches where value exceeds the count of value from items for the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE value > (
SELECT COUNT(value) FROM items AS lne
WHERE lne.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00752 | train |
v3 | Schema:
shipments (alias: shp)(name, status, level, type)
employees(name, code, id, amount)
Task: Find salary from shipments where salary exceeds the minimum amount from employees for the same level.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT MIN(amount) FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00753 | train |
v2 | Schema:
sales (alias: sale)(value, level, amount, type)
employees(level, id, name, value)
Task: Find id from sales where a matching record exists in employees with the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00754 | train |
v2 | Schema:
regions (alias: rgn)(id, amount, date, type)
tasks(amount, name, type, value)
Task: Retrieve name from regions that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT name FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "tasks",
"outer_alias": "rgn",
"inner_alias": "tsk",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00755 | train |
v3 | Schema:
requests (alias: ordr)(type, value, amount, name)
schedules(type, amount, status, name)
Task: Retrieve name from requests with salary above the SUM(salary) of schedules rows sharing the same id.
SQL: | SELECT name FROM requests AS ordr
WHERE salary > (
SELECT SUM(salary) FROM schedules AS schd
WHERE schd.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00756 | train |
v1 | Schema:
transactions (alias: txn)(value, date, name, code)
schedules(value, status, type, salary)
Task: Select code from transactions where code exists in schedules for the same id.
SQL: | SELECT code FROM transactions AS txn
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00757 | train |
v2 | Schema:
tasks (alias: tsk)(status, salary, value, date)
invoices(level, id, type, value)
Task: Find value from tasks where a matching record exists in invoices with the same type.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00758 | train |
v1 | Schema:
shipments (alias: shp)(name, id, status, level)
departments(level, date, amount, id)
Task: Retrieve name from shipments whose code is found in departments rows where code matches the outer record.
SQL: | SELECT name FROM shipments AS shp
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "departments",
"outer_alias": "shp",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00759 | train |
v3 | Schema:
categories (alias: catg)(level, date, amount, type)
departments(status, date, id, level)
Task: Retrieve value from categories with value above the COUNT(amount) of departments rows sharing the same status.
SQL: | SELECT value FROM categories AS catg
WHERE value > (
SELECT COUNT(amount) FROM departments AS dept
WHERE dept.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "departments",
"outer_alias": "catg",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00760 | train |
v3 | Schema:
managers (alias: mgr)(type, amount, date, status)
projects(name, amount, salary, status)
Task: Find id from managers where amount exceeds the minimum amount from projects for the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00761 | train |
v1 | Schema:
departments (alias: dept)(level, value, amount, name)
schedules(salary, status, name, date)
Task: Retrieve value from departments whose id is found in schedules rows where type matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00762 | train |
v1 | Schema:
departments (alias: dept)(date, amount, value, level)
sales(salary, date, status, level)
Task: Select id from departments where status exists in sales for the same id.
SQL: | SELECT id FROM departments AS dept
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "sales",
"outer_alias": "dept",
"inner_alias": "sale",
"proj_col": "id",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00763 | train |
v2 | Schema:
items (alias: lne)(salary, code, date, level)
orders(level, code, id, name)
Task: Find value from items where a matching record exists in orders with the same type.
SQL: | SELECT value FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.type = lne.type
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00764 | train |
v2 | Schema:
managers (alias: mgr)(name, status, code, amount)
sales(id, type, level, status)
Task: Retrieve id from managers that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00765 | train |
v3 | Schema:
items (alias: lne)(name, code, value, date)
invoices(amount, status, salary, name)
Task: Retrieve name from items with amount above the MIN(salary) of invoices rows sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE amount > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.code = lne.code
); | {
"outer_table": "items",
"inner_table": "invoices",
"outer_alias": "lne",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00766 | train |
v2 | Schema:
departments (alias: dept)(amount, name, code, type)
branches(date, code, value, id)
Task: Find amount from departments where a matching record exists in branches with the same type.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00767 | train |
v1 | Schema:
departments (alias: dept)(date, salary, amount, level)
schedules(salary, level, status, type)
Task: Find value from departments where id appears in schedules entries with matching level.
SQL: | SELECT value FROM departments AS dept
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00768 | train |
v2 | Schema:
accounts (alias: acct)(amount, code, salary, id)
products(id, date, level, status)
Task: Retrieve code from accounts that have at least one corresponding entry in products sharing the same type.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "products",
"outer_alias": "acct",
"inner_alias": "prod",
"proj_col": "code",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00769 | train |
v2 | Schema:
products (alias: prod)(status, date, id, amount)
managers(value, amount, code, level)
Task: Retrieve salary from products that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT salary FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = prod.id
); | {
"outer_table": "products",
"inner_table": "managers",
"outer_alias": "prod",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00770 | train |
v3 | Schema:
projects (alias: prj)(value, salary, code, id)
customers(amount, type, id, name)
Task: Find salary from projects where salary exceeds the average salary from customers for the same code.
SQL: | SELECT salary FROM projects AS prj
WHERE salary > (
SELECT AVG(salary) FROM customers AS cust
WHERE cust.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "customers",
"outer_alias": "prj",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00771 | train |
v2 | Schema:
schedules (alias: schd)(type, salary, level, id)
projects(id, date, level, salary)
Task: Find id from schedules where a matching record exists in projects with the same status.
SQL: | SELECT id FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "projects",
"outer_alias": "schd",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00772 | train |
v3 | Schema:
tasks (alias: tsk)(status, amount, name, type)
sales(status, amount, type, date)
Task: Retrieve code from tasks with value above the MIN(value) of sales rows sharing the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE value > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_00773 | train |
v1 | Schema:
schedules (alias: schd)(date, code, status, salary)
branches(level, code, name, status)
Task: Find amount from schedules where id appears in branches entries with matching level.
SQL: | SELECT amount FROM schedules AS schd
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "branches",
"outer_alias": "schd",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00774 | train |
v2 | Schema:
employees (alias: emp)(status, date, code, id)
managers(type, value, id, level)
Task: Retrieve amount from employees that have at least one corresponding entry in managers sharing the same code.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "managers",
"outer_alias": "emp",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00775 | train |
v2 | Schema:
managers (alias: mgr)(type, level, code, amount)
orders(code, value, status, amount)
Task: Retrieve amount from managers that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "orders",
"outer_alias": "mgr",
"inner_alias": "ord",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00776 | train |
v1 | Schema:
customers (alias: cust)(type, salary, status, name)
schedules(code, value, name, salary)
Task: Find salary from customers where status appears in schedules entries with matching id.
SQL: | SELECT salary FROM customers AS cust
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "schedules",
"outer_alias": "cust",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00777 | train |
v2 | Schema:
departments (alias: dept)(type, level, amount, value)
transactions(name, level, amount, value)
Task: Find id from departments where a matching record exists in transactions with the same id.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "transactions",
"outer_alias": "dept",
"inner_alias": "txn",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00778 | train |
v3 | Schema:
items (alias: lne)(code, salary, id, amount)
orders(level, status, type, value)
Task: Retrieve value from items with value above the SUM(amount) of orders rows sharing the same status.
SQL: | SELECT value FROM items AS lne
WHERE value > (
SELECT SUM(amount) FROM orders AS ord
WHERE ord.status = lne.status
); | {
"outer_table": "items",
"inner_table": "orders",
"outer_alias": "lne",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00779 | train |
v2 | Schema:
orders (alias: ord)(value, name, code, level)
requests(id, code, level, salary)
Task: Retrieve salary from orders that have at least one corresponding entry in requests sharing the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00780 | train |
v3 | Schema:
transactions (alias: txn)(status, amount, type, name)
managers(code, salary, date, amount)
Task: Retrieve value from transactions with amount above the AVG(salary) of managers rows sharing the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE amount > (
SELECT AVG(salary) FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00781 | train |
v1 | Schema:
staff (alias: empl)(code, level, name, id)
requests(amount, type, status, code)
Task: Select salary from staff where id exists in requests for the same id.
SQL: | SELECT salary FROM staff AS empl
WHERE id IN (
SELECT id FROM requests AS ordr
WHERE ordr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "salary",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_00782 | train |
v2 | Schema:
projects (alias: prj)(code, level, name, amount)
items(salary, value, amount, id)
Task: Find value from projects where a matching record exists in items with the same type.
SQL: | SELECT value FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_00783 | train |
v2 | Schema:
accounts (alias: acct)(status, code, type, salary)
employees(code, type, salary, date)
Task: Find id from accounts where a matching record exists in employees with the same level.
SQL: | SELECT id FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "employees",
"outer_alias": "acct",
"inner_alias": "emp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00784 | train |
v3 | Schema:
managers (alias: mgr)(level, amount, salary, status)
schedules(type, name, code, value)
Task: Find salary from managers where salary exceeds the average salary from schedules for the same type.
SQL: | SELECT salary FROM managers AS mgr
WHERE salary > (
SELECT AVG(salary) FROM schedules AS schd
WHERE schd.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00785 | train |
v3 | Schema:
shipments (alias: shp)(level, value, id, salary)
managers(salary, level, type, status)
Task: Retrieve value from shipments with salary above the MAX(amount) of managers rows sharing the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT MAX(amount) FROM managers AS mgr
WHERE mgr.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_00786 | train |
v1 | Schema:
categories (alias: catg)(level, code, value, amount)
customers(id, value, type, name)
Task: Retrieve code from categories whose code is found in customers rows where status matches the outer record.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM customers AS cust
WHERE cust.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00787 | train |
v3 | Schema:
sales (alias: sale)(status, amount, code, level)
transactions(value, code, level, id)
Task: Retrieve name from sales with salary above the COUNT(salary) of transactions rows sharing the same code.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "transactions",
"outer_alias": "sale",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00788 | train |
v1 | Schema:
regions (alias: rgn)(status, level, type, name)
sales(salary, value, name, status)
Task: Select name from regions where status exists in sales for the same code.
SQL: | SELECT name FROM regions AS rgn
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "sales",
"outer_alias": "rgn",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00789 | train |
v1 | Schema:
items (alias: lne)(status, type, code, level)
departments(id, status, code, type)
Task: Retrieve salary from items whose code is found in departments rows where id matches the outer record.
SQL: | SELECT salary FROM items AS lne
WHERE code IN (
SELECT code FROM departments AS dept
WHERE dept.id = lne.id
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_00790 | train |
v2 | Schema:
employees (alias: emp)(status, amount, id, type)
tasks(salary, status, type, id)
Task: Find salary from employees where a matching record exists in tasks with the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00791 | train |
v2 | Schema:
customers (alias: cust)(code, value, status, type)
tasks(level, id, status, code)
Task: Retrieve amount from customers that have at least one corresponding entry in tasks sharing the same id.
SQL: | SELECT amount FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "tasks",
"outer_alias": "cust",
"inner_alias": "tsk",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00792 | train |
v1 | Schema:
regions (alias: rgn)(salary, type, code, date)
items(salary, id, value, amount)
Task: Retrieve amount from regions whose level is found in items rows where level matches the outer record.
SQL: | SELECT amount FROM regions AS rgn
WHERE level IN (
SELECT level FROM items AS lne
WHERE lne.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "items",
"outer_alias": "rgn",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_00793 | train |
v1 | Schema:
requests (alias: ordr)(code, level, status, amount)
branches(value, status, code, date)
Task: Select value from requests where code exists in branches for the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE code IN (
SELECT code 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": "code",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00794 | train |
v2 | Schema:
branches (alias: brc)(value, salary, type, id)
customers(amount, value, type, salary)
Task: Find value from branches where a matching record exists in customers with the same level.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "customers",
"outer_alias": "brc",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_00795 | train |
v3 | Schema:
employees (alias: emp)(value, status, name, type)
invoices(code, level, value, amount)
Task: Retrieve code from employees with value above the MAX(amount) of invoices rows sharing the same status.
SQL: | SELECT code FROM employees AS emp
WHERE value > (
SELECT MAX(amount) FROM invoices AS inv
WHERE inv.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00796 | train |
v1 | Schema:
requests (alias: ordr)(code, amount, status, date)
projects(value, date, type, level)
Task: Retrieve id from requests whose id is found in projects rows where type matches the outer record.
SQL: | SELECT id FROM requests AS ordr
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "projects",
"outer_alias": "ordr",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_00797 | train |
v2 | Schema:
schedules (alias: schd)(value, level, salary, amount)
accounts(amount, id, code, status)
Task: Find name from schedules where a matching record exists in accounts with the same status.
SQL: | SELECT name FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "accounts",
"outer_alias": "schd",
"inner_alias": "acct",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_00798 | train |
v3 | Schema:
departments (alias: dept)(status, salary, value, id)
projects(salary, name, date, id)
Task: Retrieve value from departments with value above the MIN(amount) of projects rows sharing the same type.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT MIN(amount) FROM projects AS prj
WHERE prj.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_00799 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.