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 |
|---|---|---|---|---|---|---|
v3 | Schema:
schedules (alias: schd)(level, id, date, code)
categories(amount, type, code, status)
Task: Find salary from schedules where salary exceeds the total amount from categories for the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE salary > (
SELECT SUM(amount) FROM categories AS catg
WHERE catg.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "categories",
"outer_alias": "schd",
"inner_alias": "catg",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11000 | train |
v2 | Schema:
branches (alias: brc)(id, date, code, amount)
staff(amount, code, value, date)
Task: Find amount from branches where a matching record exists in staff with the same level.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11001 | train |
v2 | Schema:
branches (alias: brc)(name, salary, id, date)
regions(level, code, value, type)
Task: Find amount from branches where a matching record exists in regions with the same id.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "regions",
"outer_alias": "brc",
"inner_alias": "rgn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11002 | train |
v3 | Schema:
accounts (alias: acct)(code, salary, date, name)
managers(code, name, date, status)
Task: Retrieve code from accounts with value above the MIN(value) of managers rows sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE value > (
SELECT MIN(value) FROM managers AS mgr
WHERE mgr.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11003 | train |
v3 | Schema:
managers (alias: mgr)(amount, value, type, code)
tasks(code, type, date, name)
Task: Retrieve value from managers with salary above the MAX(amount) of tasks rows sharing the same code.
SQL: | SELECT value FROM managers AS mgr
WHERE salary > (
SELECT MAX(amount) FROM tasks AS tsk
WHERE tsk.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "tasks",
"outer_alias": "mgr",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11004 | train |
v2 | Schema:
employees (alias: emp)(id, value, status, code)
customers(id, name, date, amount)
Task: Find salary from employees where a matching record exists in customers with the same level.
SQL: | SELECT salary FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11005 | train |
v1 | Schema:
invoices (alias: inv)(amount, id, status, name)
transactions(salary, type, id, name)
Task: Select name from invoices where type exists in transactions for the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11006 | train |
v1 | Schema:
managers (alias: mgr)(value, date, status, type)
invoices(status, name, salary, value)
Task: Retrieve salary from managers whose status is found in invoices rows where status matches the outer record.
SQL: | SELECT salary FROM managers AS mgr
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "invoices",
"outer_alias": "mgr",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11007 | train |
v3 | Schema:
orders (alias: ord)(name, status, id, level)
schedules(type, salary, status, level)
Task: Find amount from orders where amount exceeds the average amount from schedules for the same id.
SQL: | SELECT amount FROM orders AS ord
WHERE amount > (
SELECT AVG(amount) FROM schedules AS schd
WHERE schd.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11008 | train |
v2 | Schema:
employees (alias: emp)(level, code, name, salary)
orders(value, amount, type, code)
Task: Retrieve value from employees that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11009 | train |
v3 | Schema:
projects (alias: prj)(amount, name, level, code)
items(salary, date, name, amount)
Task: Find name from projects where value exceeds the maximum salary from items for the same code.
SQL: | SELECT name FROM projects AS prj
WHERE value > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11010 | train |
v2 | Schema:
departments (alias: dept)(status, level, date, value)
requests(level, status, type, id)
Task: Retrieve amount from departments that have at least one corresponding entry in requests sharing the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11011 | train |
v2 | Schema:
shipments (alias: shp)(salary, id, code, status)
employees(name, salary, code, type)
Task: Find amount from shipments where a matching record exists in employees with the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11012 | train |
v3 | Schema:
requests (alias: ordr)(type, value, level, amount)
staff(id, type, status, date)
Task: Retrieve name from requests with value above the MAX(amount) of staff rows sharing the same level.
SQL: | SELECT name FROM requests AS ordr
WHERE value > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "staff",
"outer_alias": "ordr",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11013 | train |
v1 | Schema:
categories (alias: catg)(salary, type, amount, code)
orders(salary, code, date, type)
Task: Select id from categories where code exists in orders for the same level.
SQL: | SELECT id FROM categories AS catg
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "orders",
"outer_alias": "catg",
"inner_alias": "ord",
"proj_col": "id",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11014 | train |
v1 | Schema:
transactions (alias: txn)(level, status, date, amount)
departments(value, type, date, status)
Task: Find id from transactions where status appears in departments entries with matching level.
SQL: | SELECT id FROM transactions AS txn
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.level = txn.level
); | {
"outer_table": "transactions",
"inner_table": "departments",
"outer_alias": "txn",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "txn.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11015 | train |
v1 | Schema:
sales (alias: sale)(salary, name, type, id)
orders(type, salary, name, amount)
Task: Retrieve salary from sales whose code is found in orders rows where type matches the outer record.
SQL: | SELECT salary FROM sales AS sale
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "orders",
"outer_alias": "sale",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11016 | train |
v1 | Schema:
items (alias: lne)(amount, salary, name, level)
managers(id, status, code, value)
Task: Retrieve id from items whose level is found in managers rows where level matches the outer record.
SQL: | SELECT id FROM items AS lne
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.level = lne.level
); | {
"outer_table": "items",
"inner_table": "managers",
"outer_alias": "lne",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11017 | train |
v1 | Schema:
products (alias: prod)(level, type, date, id)
orders(amount, code, type, date)
Task: Retrieve name from products whose status is found in orders rows where level matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = prod.level
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "name",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11018 | train |
v2 | Schema:
employees (alias: emp)(amount, value, id, type)
orders(level, salary, id, type)
Task: Retrieve id from employees that have at least one corresponding entry in orders sharing the same code.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11019 | train |
v3 | Schema:
schedules (alias: schd)(name, date, value, status)
orders(name, value, status, amount)
Task: Retrieve value from schedules with value above the COUNT(value) of orders rows sharing the same id.
SQL: | SELECT value FROM schedules AS schd
WHERE value > (
SELECT COUNT(value) FROM orders AS ord
WHERE ord.id = schd.id
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11020 | train |
v3 | Schema:
regions (alias: rgn)(id, type, value, code)
orders(id, type, name, level)
Task: Retrieve value from regions with amount above the SUM(value) of orders rows sharing the same level.
SQL: | SELECT value FROM regions AS rgn
WHERE amount > (
SELECT SUM(value) FROM orders AS ord
WHERE ord.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "orders",
"outer_alias": "rgn",
"inner_alias": "ord",
"proj_col": "value",
"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_11021 | train |
v2 | Schema:
managers (alias: mgr)(id, name, type, status)
items(level, salary, code, value)
Task: Find name from managers where a matching record exists in items with the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11022 | train |
v2 | Schema:
shipments (alias: shp)(amount, name, value, date)
invoices(code, salary, level, status)
Task: Find id from shipments where a matching record exists in invoices with the same id.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11023 | train |
v2 | Schema:
schedules (alias: schd)(status, id, salary, level)
shipments(type, amount, level, status)
Task: Retrieve value from schedules that have at least one corresponding entry in shipments sharing the same type.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "shipments",
"outer_alias": "schd",
"inner_alias": "shp",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11024 | train |
v2 | Schema:
transactions (alias: txn)(salary, date, status, code)
schedules(status, name, code, date)
Task: Retrieve salary from transactions that have at least one corresponding entry in schedules sharing the same code.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11025 | train |
v3 | Schema:
invoices (alias: inv)(date, amount, level, code)
branches(value, amount, status, date)
Task: Retrieve id from invoices with salary above the COUNT(amount) of branches rows sharing the same status.
SQL: | SELECT id FROM invoices AS inv
WHERE salary > (
SELECT COUNT(amount) FROM branches AS brc
WHERE brc.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11026 | train |
v2 | Schema:
items (alias: lne)(type, date, value, status)
requests(type, level, date, name)
Task: Find id from items where a matching record exists in requests with the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.status = lne.status
); | {
"outer_table": "items",
"inner_table": "requests",
"outer_alias": "lne",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11027 | train |
v3 | Schema:
transactions (alias: txn)(salary, id, status, name)
projects(amount, name, salary, date)
Task: Find name from transactions where value exceeds the total amount from projects for the same type.
SQL: | SELECT name FROM transactions AS txn
WHERE value > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11028 | train |
v3 | Schema:
shipments (alias: shp)(salary, code, date, level)
tasks(status, name, amount, salary)
Task: Find salary from shipments where salary exceeds the minimum salary from tasks for the same id.
SQL: | SELECT salary FROM shipments AS shp
WHERE salary > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "tasks",
"outer_alias": "shp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11029 | train |
v1 | Schema:
invoices (alias: inv)(code, salary, level, value)
products(name, amount, value, id)
Task: Retrieve amount from invoices whose level is found in products rows where code matches the outer record.
SQL: | SELECT amount FROM invoices AS inv
WHERE level IN (
SELECT level FROM products AS prod
WHERE prod.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "products",
"outer_alias": "inv",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11030 | train |
v2 | Schema:
categories (alias: catg)(type, level, date, code)
invoices(level, name, amount, value)
Task: Retrieve name from categories that have at least one corresponding entry in invoices sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "invoices",
"outer_alias": "catg",
"inner_alias": "inv",
"proj_col": "name",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11031 | train |
v1 | Schema:
managers (alias: mgr)(code, value, salary, amount)
staff(id, name, date, status)
Task: Find code from managers where id appears in staff entries with matching code.
SQL: | SELECT code FROM managers AS mgr
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "staff",
"outer_alias": "mgr",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11032 | train |
v3 | Schema:
customers (alias: cust)(name, date, code, level)
branches(code, level, status, date)
Task: Find code from customers where salary exceeds the count of salary from branches for the same status.
SQL: | SELECT code FROM customers AS cust
WHERE salary > (
SELECT COUNT(salary) FROM branches AS brc
WHERE brc.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "branches",
"outer_alias": "cust",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11033 | train |
v2 | Schema:
invoices (alias: inv)(type, date, salary, code)
departments(code, level, type, date)
Task: Find salary from invoices where a matching record exists in departments with the same type.
SQL: | SELECT salary FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "departments",
"outer_alias": "inv",
"inner_alias": "dept",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11034 | train |
v1 | Schema:
shipments (alias: shp)(status, code, id, name)
regions(status, name, date, level)
Task: Select name from shipments where id exists in regions for the same status.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM regions AS rgn
WHERE rgn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "regions",
"outer_alias": "shp",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11035 | train |
v1 | Schema:
shipments (alias: shp)(code, salary, type, id)
employees(code, value, level, status)
Task: Select name from shipments where level exists in employees for the same code.
SQL: | SELECT name FROM shipments AS shp
WHERE level IN (
SELECT level FROM employees AS emp
WHERE emp.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11036 | train |
v1 | Schema:
managers (alias: mgr)(type, name, amount, id)
customers(name, code, date, status)
Task: Retrieve name from managers whose id is found in customers rows where id matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "customers",
"outer_alias": "mgr",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11037 | train |
v3 | Schema:
staff (alias: empl)(id, salary, value, type)
requests(salary, type, date, name)
Task: Find id from staff where amount exceeds the average salary from requests for the same id.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT AVG(salary) FROM requests AS ordr
WHERE ordr.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "requests",
"outer_alias": "empl",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_11038 | train |
v3 | Schema:
projects (alias: prj)(amount, name, code, id)
transactions(level, value, code, date)
Task: Retrieve id from projects with amount above the COUNT(salary) of transactions rows sharing the same code.
SQL: | SELECT id FROM projects AS prj
WHERE amount > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11039 | train |
v1 | Schema:
customers (alias: cust)(name, value, status, amount)
employees(name, date, code, amount)
Task: Select value from customers where status exists in employees for the same code.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM employees AS emp
WHERE emp.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "employees",
"outer_alias": "cust",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11040 | train |
v2 | Schema:
tasks (alias: tsk)(id, amount, code, type)
customers(level, type, salary, status)
Task: Retrieve amount from tasks that have at least one corresponding entry in customers sharing the same status.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "customers",
"outer_alias": "tsk",
"inner_alias": "cust",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11041 | train |
v3 | Schema:
departments (alias: dept)(amount, status, level, type)
products(salary, status, amount, level)
Task: Find value from departments where value exceeds the count of amount from products for the same type.
SQL: | SELECT value FROM departments AS dept
WHERE value > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "products",
"outer_alias": "dept",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11042 | train |
v3 | Schema:
orders (alias: ord)(value, name, type, amount)
projects(id, name, value, status)
Task: Find value from orders where value exceeds the total amount from projects for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE value > (
SELECT SUM(amount) FROM projects AS prj
WHERE prj.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "projects",
"outer_alias": "ord",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11043 | train |
v1 | Schema:
sales (alias: sale)(type, code, name, status)
employees(code, level, salary, status)
Task: Find code from sales where id appears in employees entries with matching status.
SQL: | SELECT code FROM sales AS sale
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "employees",
"outer_alias": "sale",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11044 | train |
v1 | Schema:
sales (alias: sale)(status, amount, code, date)
tasks(value, code, salary, amount)
Task: Select id from sales where level exists in tasks for the same status.
SQL: | SELECT id FROM sales AS sale
WHERE level IN (
SELECT level FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11045 | train |
v1 | Schema:
accounts (alias: acct)(salary, value, id, amount)
regions(name, id, amount, level)
Task: Retrieve id from accounts whose level is found in regions rows where level matches the outer record.
SQL: | SELECT id FROM accounts AS acct
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "regions",
"outer_alias": "acct",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11046 | train |
v1 | Schema:
transactions (alias: txn)(type, name, date, value)
sales(amount, type, salary, name)
Task: Retrieve salary from transactions whose level is found in sales rows where type matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE level IN (
SELECT level FROM sales AS sale
WHERE sale.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "sales",
"outer_alias": "txn",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11047 | train |
v3 | Schema:
accounts (alias: acct)(salary, code, status, name)
projects(salary, id, amount, name)
Task: Find name from accounts where value exceeds the maximum amount from projects for the same id.
SQL: | SELECT name FROM accounts AS acct
WHERE value > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "projects",
"outer_alias": "acct",
"inner_alias": "prj",
"proj_col": "name",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11048 | train |
v2 | Schema:
accounts (alias: acct)(status, amount, value, salary)
managers(type, value, amount, salary)
Task: Retrieve amount from accounts that have at least one corresponding entry in managers sharing the same id.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.id = acct.id
); | {
"outer_table": "accounts",
"inner_table": "managers",
"outer_alias": "acct",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "acct.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11049 | train |
v1 | Schema:
accounts (alias: acct)(name, date, value, status)
tasks(salary, id, type, value)
Task: Select code from accounts where type exists in tasks for the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "tasks",
"outer_alias": "acct",
"inner_alias": "tsk",
"proj_col": "code",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11050 | train |
v2 | Schema:
branches (alias: brc)(amount, salary, level, id)
accounts(amount, value, code, status)
Task: Find id from branches where a matching record exists in accounts with the same status.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "accounts",
"outer_alias": "brc",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11051 | train |
v3 | Schema:
products (alias: prod)(name, date, code, value)
departments(value, type, level, code)
Task: Retrieve name from products with value above the AVG(value) of departments rows sharing the same level.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.level = prod.level
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11052 | train |
v1 | Schema:
shipments (alias: shp)(amount, value, status, date)
customers(status, date, name, type)
Task: Find name from shipments where id appears in customers entries with matching type.
SQL: | SELECT name FROM shipments AS shp
WHERE id IN (
SELECT id FROM customers AS cust
WHERE cust.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11053 | train |
v1 | Schema:
shipments (alias: shp)(salary, id, level, name)
managers(id, salary, value, level)
Task: Find amount from shipments where level appears in managers entries with matching id.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "managers",
"outer_alias": "shp",
"inner_alias": "mgr",
"proj_col": "amount",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11054 | train |
v3 | Schema:
employees (alias: emp)(salary, level, id, status)
staff(name, type, level, amount)
Task: Retrieve name from employees with salary above the COUNT(value) of staff rows sharing the same status.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT COUNT(value) FROM staff AS empl
WHERE empl.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "staff",
"outer_alias": "emp",
"inner_alias": "empl",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11055 | train |
v3 | Schema:
orders (alias: ord)(code, status, amount, name)
tasks(type, name, amount, id)
Task: Find id from orders where value exceeds the minimum salary from tasks for the same code.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MIN(salary) FROM tasks AS tsk
WHERE tsk.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "tasks",
"outer_alias": "ord",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11056 | train |
v1 | Schema:
departments (alias: dept)(status, id, type, date)
tasks(name, status, id, code)
Task: Retrieve value from departments whose code is found in tasks rows where status matches the outer record.
SQL: | SELECT value FROM departments AS dept
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "tasks",
"outer_alias": "dept",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11057 | train |
v2 | Schema:
accounts (alias: acct)(type, date, level, value)
items(date, salary, id, status)
Task: Find name from accounts where a matching record exists in items with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11058 | train |
v2 | Schema:
orders (alias: ord)(name, code, status, amount)
regions(amount, level, code, name)
Task: Find name from orders where a matching record exists in regions with the same status.
SQL: | SELECT name FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = ord.status
); | {
"outer_table": "orders",
"inner_table": "regions",
"outer_alias": "ord",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "ord.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11059 | train |
v1 | Schema:
customers (alias: cust)(code, amount, name, level)
managers(code, status, value, level)
Task: Find salary from customers where level appears in managers entries with matching id.
SQL: | SELECT salary FROM customers AS cust
WHERE level IN (
SELECT level FROM managers AS mgr
WHERE mgr.id = cust.id
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "salary",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "cust.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11060 | train |
v2 | Schema:
products (alias: prod)(type, status, salary, id)
categories(code, date, salary, level)
Task: Find amount from products where a matching record exists in categories with the same type.
SQL: | SELECT amount FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11061 | train |
v3 | Schema:
managers (alias: mgr)(value, type, salary, code)
transactions(status, type, value, name)
Task: Find id from managers where value exceeds the count of salary from transactions for the same status.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT COUNT(salary) FROM transactions AS txn
WHERE txn.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "transactions",
"outer_alias": "mgr",
"inner_alias": "txn",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11062 | train |
v2 | Schema:
managers (alias: mgr)(value, salary, level, name)
items(status, code, type, name)
Task: Retrieve name from managers that have at least one corresponding entry in items sharing the same level.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11063 | train |
v3 | Schema:
sales (alias: sale)(status, value, type, name)
customers(amount, type, date, level)
Task: Find code from sales where amount exceeds the maximum salary from customers for the same type.
SQL: | SELECT code FROM sales AS sale
WHERE amount > (
SELECT MAX(salary) FROM customers AS cust
WHERE cust.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11064 | train |
v2 | Schema:
shipments (alias: shp)(name, id, date, amount)
transactions(date, id, salary, level)
Task: Retrieve amount from shipments that have at least one corresponding entry in transactions sharing the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "transactions",
"outer_alias": "shp",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_11065 | train |
v1 | Schema:
branches (alias: brc)(id, status, code, amount)
employees(type, date, code, amount)
Task: Select value from branches where id exists in employees for the same level.
SQL: | SELECT value FROM branches AS brc
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "value",
"filter_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11066 | train |
v3 | Schema:
invoices (alias: inv)(status, name, salary, date)
regions(date, salary, value, level)
Task: Find value from invoices where salary exceeds the count of salary from regions for the same code.
SQL: | SELECT value FROM invoices AS inv
WHERE salary > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11067 | train |
v2 | Schema:
schedules (alias: schd)(status, value, name, level)
requests(amount, code, value, id)
Task: Find salary from schedules where a matching record exists in requests with the same code.
SQL: | SELECT salary FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "requests",
"outer_alias": "schd",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11068 | train |
v3 | Schema:
requests (alias: ordr)(value, level, amount, date)
sales(name, level, type, date)
Task: Retrieve amount from requests with salary above the SUM(amount) of sales rows sharing the same level.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM sales AS sale
WHERE sale.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "sales",
"outer_alias": "ordr",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11069 | train |
v3 | Schema:
products (alias: prod)(type, code, name, amount)
staff(value, type, level, name)
Task: Retrieve value from products with amount above the MIN(value) of staff rows sharing the same code.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT MIN(value) FROM staff AS empl
WHERE empl.code = prod.code
); | {
"outer_table": "products",
"inner_table": "staff",
"outer_alias": "prod",
"inner_alias": "empl",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11070 | train |
v1 | Schema:
items (alias: lne)(type, id, code, level)
departments(id, level, amount, date)
Task: Find id from items where status appears in departments entries with matching type.
SQL: | SELECT id FROM items AS lne
WHERE status IN (
SELECT status FROM departments AS dept
WHERE dept.type = lne.type
); | {
"outer_table": "items",
"inner_table": "departments",
"outer_alias": "lne",
"inner_alias": "dept",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "lne.type",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_11071 | train |
v2 | Schema:
managers (alias: mgr)(level, amount, status, type)
departments(salary, name, type, status)
Task: Find code from managers where a matching record exists in departments with the same code.
SQL: | SELECT code FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "departments",
"outer_alias": "mgr",
"inner_alias": "dept",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11072 | train |
v2 | Schema:
categories (alias: catg)(amount, salary, type, value)
products(salary, status, id, code)
Task: Retrieve value from categories that have at least one corresponding entry in products sharing the same code.
SQL: | SELECT value FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = catg.code
); | {
"outer_table": "categories",
"inner_table": "products",
"outer_alias": "catg",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "catg.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11073 | train |
v1 | Schema:
requests (alias: ordr)(amount, level, name, type)
tasks(salary, id, amount, code)
Task: Select value from requests where id exists in tasks for the same id.
SQL: | SELECT value FROM requests AS ordr
WHERE id IN (
SELECT id FROM tasks AS tsk
WHERE tsk.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "tasks",
"outer_alias": "ordr",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11074 | train |
v2 | Schema:
sales (alias: sale)(level, salary, date, type)
customers(id, name, level, value)
Task: Retrieve id from sales that have at least one corresponding entry in customers sharing the same level.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "customers",
"outer_alias": "sale",
"inner_alias": "cust",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11075 | train |
v1 | Schema:
branches (alias: brc)(status, code, id, level)
staff(value, id, date, name)
Task: Select id from branches where id exists in staff for the same code.
SQL: | SELECT id FROM branches AS brc
WHERE id IN (
SELECT id FROM staff AS empl
WHERE empl.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "staff",
"outer_alias": "brc",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11076 | train |
v1 | Schema:
projects (alias: prj)(salary, amount, code, level)
branches(value, status, level, salary)
Task: Select code from projects where status exists in branches for the same status.
SQL: | SELECT code FROM projects AS prj
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.status = prj.status
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "prj.status",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_11077 | train |
v1 | Schema:
customers (alias: cust)(amount, name, salary, type)
invoices(name, id, salary, value)
Task: Select name from customers where status exists in invoices for the same type.
SQL: | SELECT name FROM customers AS cust
WHERE status IN (
SELECT status FROM invoices AS inv
WHERE inv.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "invoices",
"outer_alias": "cust",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11078 | train |
v2 | Schema:
branches (alias: brc)(amount, status, value, code)
products(code, status, salary, type)
Task: Find id from branches where a matching record exists in products with the same type.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "products",
"outer_alias": "brc",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11079 | train |
v3 | Schema:
employees (alias: emp)(amount, salary, type, level)
customers(code, type, amount, salary)
Task: Find value from employees where value exceeds the minimum amount from customers for the same type.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MIN(amount) FROM customers AS cust
WHERE cust.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "customers",
"outer_alias": "emp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11080 | train |
v2 | Schema:
tasks (alias: tsk)(level, amount, salary, code)
staff(name, code, salary, value)
Task: Retrieve value from tasks that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = tsk.code
); | {
"outer_table": "tasks",
"inner_table": "staff",
"outer_alias": "tsk",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "tsk.code",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11081 | train |
v3 | Schema:
departments (alias: dept)(value, type, name, id)
requests(salary, level, type, name)
Task: Find code from departments where value exceeds the maximum amount from requests for the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT MAX(amount) FROM requests AS ordr
WHERE ordr.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "requests",
"outer_alias": "dept",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11082 | train |
v1 | Schema:
customers (alias: cust)(status, id, amount, name)
products(date, value, type, id)
Task: Retrieve amount from customers whose id is found in products rows where code matches the outer record.
SQL: | SELECT amount FROM customers AS cust
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "amount",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11083 | train |
v3 | Schema:
requests (alias: ordr)(salary, type, id, status)
items(code, level, date, id)
Task: Retrieve code from requests with amount above the MAX(salary) of items rows sharing the same code.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM items AS lne
WHERE lne.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "items",
"outer_alias": "ordr",
"inner_alias": "lne",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11084 | train |
v3 | Schema:
invoices (alias: inv)(type, id, level, status)
categories(id, code, salary, value)
Task: Find code from invoices where value exceeds the count of value from categories for the same status.
SQL: | SELECT code FROM invoices AS inv
WHERE value > (
SELECT COUNT(value) FROM categories AS catg
WHERE catg.status = inv.status
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "inv.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11085 | train |
v3 | Schema:
schedules (alias: schd)(type, level, salary, date)
categories(salary, date, amount, name)
Task: Retrieve id from schedules with amount above the SUM(salary) of categories rows sharing the same code.
SQL: | SELECT id FROM schedules AS schd
WHERE amount > (
SELECT SUM(salary) 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": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11086 | train |
v3 | Schema:
requests (alias: ordr)(status, value, salary, level)
transactions(level, amount, name, type)
Task: Retrieve value from requests with amount above the AVG(value) of transactions rows sharing the same type.
SQL: | SELECT value FROM requests AS ordr
WHERE amount > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "transactions",
"outer_alias": "ordr",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_11087 | train |
v2 | Schema:
branches (alias: brc)(code, amount, salary, id)
requests(level, type, name, code)
Task: Find amount from branches where a matching record exists in requests with the same type.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "requests",
"outer_alias": "brc",
"inner_alias": "ordr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_11088 | train |
v3 | Schema:
accounts (alias: acct)(name, date, code, amount)
customers(name, code, amount, level)
Task: Retrieve code from accounts with salary above the AVG(value) of customers rows sharing the same level.
SQL: | SELECT code FROM accounts AS acct
WHERE salary > (
SELECT AVG(value) FROM customers AS cust
WHERE cust.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "customers",
"outer_alias": "acct",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11089 | train |
v3 | Schema:
employees (alias: emp)(amount, code, salary, type)
branches(date, name, code, type)
Task: Find value from employees where amount exceeds the minimum value from branches for the same id.
SQL: | SELECT value FROM employees AS emp
WHERE amount > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11090 | train |
v1 | Schema:
schedules (alias: schd)(name, code, id, salary)
sales(status, name, level, id)
Task: Retrieve code from schedules whose status is found in sales rows where level matches the outer record.
SQL: | SELECT code FROM schedules AS schd
WHERE status IN (
SELECT status FROM sales AS sale
WHERE sale.level = schd.level
); | {
"outer_table": "schedules",
"inner_table": "sales",
"outer_alias": "schd",
"inner_alias": "sale",
"proj_col": "code",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "schd.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11091 | train |
v2 | Schema:
schedules (alias: schd)(value, id, level, type)
requests(type, date, code, salary)
Task: Find value from schedules where a matching record exists in requests with the same id.
SQL: | SELECT value 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": "value",
"join_col": "id",
"correlated_ref": "schd.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11092 | train |
v2 | Schema:
invoices (alias: inv)(name, value, id, code)
shipments(status, amount, type, date)
Task: Find id from invoices where a matching record exists in shipments with the same level.
SQL: | SELECT id FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11093 | train |
v2 | Schema:
managers (alias: mgr)(type, amount, code, name)
requests(id, date, value, name)
Task: Find id from managers where a matching record exists in requests with the same type.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11094 | train |
v3 | Schema:
categories (alias: catg)(type, salary, date, value)
sales(code, type, id, salary)
Task: Retrieve name from categories with salary above the MIN(value) of sales rows sharing the same type.
SQL: | SELECT name FROM categories AS catg
WHERE salary > (
SELECT MIN(value) FROM sales AS sale
WHERE sale.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "sales",
"outer_alias": "catg",
"inner_alias": "sale",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_11095 | train |
v1 | Schema:
sales (alias: sale)(code, name, date, value)
products(amount, level, code, date)
Task: Select code from sales where id exists in products for the same code.
SQL: | SELECT code FROM sales AS sale
WHERE id IN (
SELECT id FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "code",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11096 | train |
v2 | Schema:
tasks (alias: tsk)(amount, id, salary, type)
requests(id, level, value, code)
Task: Find code from tasks where a matching record exists in requests with the same id.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "requests",
"outer_alias": "tsk",
"inner_alias": "ordr",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_11097 | train |
v2 | Schema:
orders (alias: ord)(code, level, id, salary)
staff(level, code, date, amount)
Task: Find value from orders where a matching record exists in staff with the same level.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11098 | train |
v1 | Schema:
departments (alias: dept)(level, id, amount, value)
projects(status, level, date, salary)
Task: Find value from departments where status appears in projects entries with matching code.
SQL: | SELECT value FROM departments AS dept
WHERE status IN (
SELECT status FROM projects AS prj
WHERE prj.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "projects",
"outer_alias": "dept",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_11099 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.