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:
shipments (alias: shp)(code, id, amount, name)
orders(status, amount, code, name)
Task: Select amount from shipments where level exists in orders for the same status.
SQL: | SELECT amount FROM shipments AS shp
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05600 | train |
v1 | Schema:
orders (alias: ord)(amount, type, code, id)
branches(id, salary, status, value)
Task: Retrieve name from orders whose status is found in branches rows where id matches the outer record.
SQL: | SELECT name FROM orders AS ord
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05601 | train |
v3 | Schema:
employees (alias: emp)(salary, amount, date, code)
invoices(salary, status, amount, date)
Task: Retrieve name from employees with salary above the MAX(value) of invoices rows sharing the same code.
SQL: | SELECT name FROM employees AS emp
WHERE salary > (
SELECT MAX(value) FROM invoices AS inv
WHERE inv.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05602 | train |
v3 | Schema:
invoices (alias: inv)(type, id, status, value)
categories(salary, amount, level, id)
Task: Find code from invoices where salary exceeds the average value from categories for the same level.
SQL: | SELECT code FROM invoices AS inv
WHERE salary > (
SELECT AVG(value) FROM categories AS catg
WHERE catg.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "categories",
"outer_alias": "inv",
"inner_alias": "catg",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05603 | train |
v2 | Schema:
tasks (alias: tsk)(status, date, amount, value)
staff(name, id, status, code)
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_05604 | train |
v3 | Schema:
staff (alias: empl)(code, date, value, type)
employees(salary, date, level, name)
Task: Find salary from staff where salary exceeds the maximum value from employees for the same level.
SQL: | SELECT salary FROM staff AS empl
WHERE salary > (
SELECT MAX(value) FROM employees AS emp
WHERE emp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "employees",
"outer_alias": "empl",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05605 | train |
v2 | Schema:
orders (alias: ord)(salary, id, amount, value)
invoices(salary, level, type, date)
Task: Find salary from orders where a matching record exists in invoices with the same code.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05606 | train |
v2 | Schema:
tasks (alias: tsk)(value, date, code, level)
invoices(date, id, type, salary)
Task: Find value from tasks where a matching record exists in invoices with the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "invoices",
"outer_alias": "tsk",
"inner_alias": "inv",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05607 | train |
v2 | Schema:
schedules (alias: schd)(level, date, type, code)
invoices(salary, code, level, date)
Task: Retrieve amount from schedules that have at least one corresponding entry in invoices sharing the same status.
SQL: | SELECT amount FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.status = schd.status
); | {
"outer_table": "schedules",
"inner_table": "invoices",
"outer_alias": "schd",
"inner_alias": "inv",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "schd.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05608 | train |
v2 | Schema:
shipments (alias: shp)(value, name, salary, id)
invoices(type, value, level, id)
Task: Retrieve id from shipments that have at least one corresponding entry in invoices sharing the same level.
SQL: | SELECT id FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM invoices AS inv
WHERE inv.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "invoices",
"outer_alias": "shp",
"inner_alias": "inv",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05609 | train |
v2 | Schema:
shipments (alias: shp)(salary, date, amount, name)
employees(value, date, code, id)
Task: Find code from shipments where a matching record exists in employees with the same id.
SQL: | SELECT code FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05610 | train |
v2 | Schema:
branches (alias: brc)(status, level, date, name)
projects(status, id, date, name)
Task: Retrieve id from branches that have at least one corresponding entry in projects sharing the same type.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "projects",
"outer_alias": "brc",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05611 | train |
v3 | Schema:
departments (alias: dept)(id, value, salary, status)
customers(id, level, code, type)
Task: Retrieve code from departments with amount above the SUM(value) of customers rows sharing the same status.
SQL: | SELECT code FROM departments AS dept
WHERE amount > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05612 | train |
v2 | Schema:
tasks (alias: tsk)(value, level, amount, id)
sales(salary, level, type, status)
Task: Retrieve code from tasks that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT code FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05613 | train |
v1 | Schema:
products (alias: prod)(type, level, amount, status)
departments(date, salary, status, name)
Task: Retrieve name from products whose id is found in departments rows where status matches the outer record.
SQL: | SELECT name FROM products AS prod
WHERE id IN (
SELECT id FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05614 | train |
v1 | Schema:
orders (alias: ord)(value, level, date, amount)
transactions(code, level, name, date)
Task: Select value from orders where type exists in transactions for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE type IN (
SELECT type FROM transactions AS txn
WHERE txn.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "transactions",
"outer_alias": "ord",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05615 | train |
v1 | Schema:
employees (alias: emp)(value, status, salary, type)
branches(type, id, level, code)
Task: Find salary from employees where id appears in branches entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE id IN (
SELECT id FROM branches AS brc
WHERE brc.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05616 | train |
v3 | Schema:
requests (alias: ordr)(name, value, code, status)
departments(type, level, id, salary)
Task: Retrieve name from requests with amount above the MAX(value) of departments rows sharing the same status.
SQL: | SELECT name FROM requests AS ordr
WHERE amount > (
SELECT MAX(value) FROM departments AS dept
WHERE dept.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "departments",
"outer_alias": "ordr",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05617 | train |
v1 | Schema:
shipments (alias: shp)(amount, salary, code, status)
projects(value, name, code, id)
Task: Retrieve id from shipments whose level is found in projects rows where id matches the outer record.
SQL: | SELECT id FROM shipments AS shp
WHERE level IN (
SELECT level FROM projects AS prj
WHERE prj.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "projects",
"outer_alias": "shp",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "level",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05618 | train |
v2 | Schema:
transactions (alias: txn)(level, salary, code, amount)
items(status, value, amount, date)
Task: Find amount from transactions where a matching record exists in items with the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05619 | train |
v1 | Schema:
invoices (alias: inv)(level, code, value, id)
transactions(code, id, date, type)
Task: Select name from invoices where id exists in transactions for the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE id IN (
SELECT id FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "name",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05620 | train |
v2 | Schema:
products (alias: prod)(amount, status, name, salary)
orders(amount, name, id, date)
Task: Retrieve id from products that have at least one corresponding entry in orders sharing the same level.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM orders AS ord
WHERE ord.level = prod.level
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05621 | train |
v2 | Schema:
staff (alias: empl)(name, level, status, date)
items(status, id, type, code)
Task: Find salary from staff where a matching record exists in items with the same code.
SQL: | SELECT salary FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.code = empl.code
); | {
"outer_table": "staff",
"inner_table": "items",
"outer_alias": "empl",
"inner_alias": "lne",
"proj_col": "salary",
"join_col": "code",
"correlated_ref": "empl.code",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05622 | train |
v3 | Schema:
invoices (alias: inv)(status, salary, amount, level)
shipments(id, status, code, name)
Task: Find value from invoices where amount exceeds the total amount from shipments for the same type.
SQL: | SELECT value FROM invoices AS inv
WHERE amount > (
SELECT SUM(amount) FROM shipments AS shp
WHERE shp.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "shipments",
"outer_alias": "inv",
"inner_alias": "shp",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05623 | train |
v2 | Schema:
schedules (alias: schd)(date, type, salary, level)
regions(status, amount, salary, type)
Task: Retrieve value from schedules that have at least one corresponding entry in regions sharing the same code.
SQL: | SELECT value FROM schedules AS schd
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.code = schd.code
); | {
"outer_table": "schedules",
"inner_table": "regions",
"outer_alias": "schd",
"inner_alias": "rgn",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "schd.code",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05624 | train |
v3 | Schema:
tasks (alias: tsk)(amount, code, salary, name)
employees(code, type, level, date)
Task: Retrieve salary from tasks with salary above the AVG(salary) of employees rows sharing the same id.
SQL: | SELECT salary FROM tasks AS tsk
WHERE salary > (
SELECT AVG(salary) FROM employees AS emp
WHERE emp.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "employees",
"outer_alias": "tsk",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05625 | train |
v3 | Schema:
orders (alias: ord)(salary, status, code, id)
requests(amount, name, id, level)
Task: Retrieve id from orders with value above the MIN(value) of requests rows sharing the same id.
SQL: | SELECT id FROM orders AS ord
WHERE value > (
SELECT MIN(value) FROM requests AS ordr
WHERE ordr.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "requests",
"outer_alias": "ord",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05626 | train |
v1 | Schema:
departments (alias: dept)(value, level, amount, id)
accounts(status, amount, code, name)
Task: Retrieve salary from departments whose level is found in accounts rows where status matches the outer record.
SQL: | SELECT salary FROM departments AS dept
WHERE level IN (
SELECT level FROM accounts AS acct
WHERE acct.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "accounts",
"outer_alias": "dept",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "level",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05627 | train |
v1 | Schema:
shipments (alias: shp)(code, name, status, date)
schedules(salary, value, amount, status)
Task: Find salary from shipments where code appears in schedules entries with matching type.
SQL: | SELECT salary FROM shipments AS shp
WHERE code IN (
SELECT code FROM schedules AS schd
WHERE schd.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05628 | train |
v1 | Schema:
staff (alias: empl)(amount, value, salary, level)
regions(type, name, amount, value)
Task: Select id from staff where level exists in regions for the same level.
SQL: | SELECT id FROM staff AS empl
WHERE level IN (
SELECT level FROM regions AS rgn
WHERE rgn.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "regions",
"outer_alias": "empl",
"inner_alias": "rgn",
"proj_col": "id",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05629 | train |
v2 | Schema:
employees (alias: emp)(name, salary, level, date)
departments(amount, code, status, date)
Task: Find id from employees where a matching record exists in departments with the same status.
SQL: | SELECT id FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05630 | train |
v2 | Schema:
orders (alias: ord)(salary, amount, code, type)
accounts(code, status, date, type)
Task: Retrieve value from orders that have at least one corresponding entry in accounts sharing the same id.
SQL: | SELECT value FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "accounts",
"outer_alias": "ord",
"inner_alias": "acct",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05631 | train |
v3 | Schema:
products (alias: prod)(status, name, type, date)
regions(code, id, name, date)
Task: Retrieve value from products with value above the SUM(value) of regions rows sharing the same type.
SQL: | SELECT value FROM products AS prod
WHERE value > (
SELECT SUM(value) FROM regions AS rgn
WHERE rgn.type = prod.type
); | {
"outer_table": "products",
"inner_table": "regions",
"outer_alias": "prod",
"inner_alias": "rgn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05632 | train |
v3 | Schema:
orders (alias: ord)(type, name, amount, value)
invoices(type, code, name, level)
Task: Retrieve code from orders with salary above the MIN(amount) of invoices rows sharing the same level.
SQL: | SELECT code FROM orders AS ord
WHERE salary > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "invoices",
"outer_alias": "ord",
"inner_alias": "inv",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05633 | train |
v2 | Schema:
customers (alias: cust)(level, value, type, salary)
products(code, name, date, level)
Task: Find value from customers where a matching record exists in products with the same code.
SQL: | SELECT value FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = cust.code
); | {
"outer_table": "customers",
"inner_table": "products",
"outer_alias": "cust",
"inner_alias": "prod",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "cust.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05634 | train |
v3 | Schema:
departments (alias: dept)(value, status, name, date)
branches(status, date, amount, value)
Task: Retrieve code from departments with value above the SUM(amount) of branches rows sharing the same code.
SQL: | SELECT code FROM departments AS dept
WHERE value > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "branches",
"outer_alias": "dept",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05635 | train |
v1 | Schema:
departments (alias: dept)(value, status, level, name)
employees(value, level, salary, type)
Task: Find amount from departments where type appears in employees entries with matching id.
SQL: | SELECT amount FROM departments AS dept
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05636 | train |
v1 | Schema:
orders (alias: ord)(type, value, salary, date)
schedules(date, salary, type, status)
Task: Retrieve id from orders whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT id FROM orders AS ord
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "schedules",
"outer_alias": "ord",
"inner_alias": "schd",
"proj_col": "id",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05637 | train |
v1 | Schema:
categories (alias: catg)(level, name, amount, type)
staff(status, level, type, salary)
Task: Find code from categories where code appears in staff entries with matching type.
SQL: | SELECT code FROM categories AS catg
WHERE code IN (
SELECT code FROM staff AS empl
WHERE empl.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "staff",
"outer_alias": "catg",
"inner_alias": "empl",
"proj_col": "code",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05638 | train |
v2 | Schema:
transactions (alias: txn)(date, amount, type, code)
projects(status, level, value, code)
Task: Find value from transactions where a matching record exists in projects with the same type.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "projects",
"outer_alias": "txn",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05639 | train |
v1 | Schema:
branches (alias: brc)(level, value, salary, name)
tasks(value, level, amount, salary)
Task: Find amount from branches where type appears in tasks entries with matching code.
SQL: | SELECT amount FROM branches AS brc
WHERE type IN (
SELECT type FROM tasks AS tsk
WHERE tsk.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05640 | train |
v1 | Schema:
products (alias: prod)(name, id, level, status)
accounts(id, status, amount, date)
Task: Find salary from products where id appears in accounts entries with matching code.
SQL: | SELECT salary FROM products AS prod
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.code = prod.code
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05641 | train |
v2 | Schema:
tasks (alias: tsk)(status, salary, level, amount)
regions(date, id, name, type)
Task: Retrieve id from tasks that have at least one corresponding entry in regions sharing the same status.
SQL: | SELECT id FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05642 | train |
v3 | Schema:
employees (alias: emp)(type, value, code, amount)
accounts(date, value, id, status)
Task: Find salary from employees where amount exceeds the average amount from accounts for the same type.
SQL: | SELECT salary FROM employees AS emp
WHERE amount > (
SELECT AVG(amount) FROM accounts AS acct
WHERE acct.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "accounts",
"outer_alias": "emp",
"inner_alias": "acct",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05643 | train |
v1 | Schema:
projects (alias: prj)(name, type, date, salary)
branches(name, code, id, date)
Task: Select name from projects where code exists in branches for the same level.
SQL: | SELECT name FROM projects AS prj
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05644 | train |
v1 | Schema:
tasks (alias: tsk)(amount, status, type, code)
categories(code, amount, date, name)
Task: Retrieve id from tasks whose type is found in categories rows where status matches the outer record.
SQL: | SELECT id FROM tasks AS tsk
WHERE type IN (
SELECT type FROM categories AS catg
WHERE catg.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "categories",
"outer_alias": "tsk",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "type",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05645 | train |
v2 | Schema:
tasks (alias: tsk)(date, value, level, id)
regions(status, type, amount, id)
Task: Find salary from tasks where a matching record exists in regions with the same level.
SQL: | SELECT salary FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.level = tsk.level
); | {
"outer_table": "tasks",
"inner_table": "regions",
"outer_alias": "tsk",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "tsk.level",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05646 | train |
v2 | Schema:
branches (alias: brc)(level, value, status, id)
schedules(type, id, date, name)
Task: Find id from branches where a matching record exists in schedules with the same id.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = brc.id
); | {
"outer_table": "branches",
"inner_table": "schedules",
"outer_alias": "brc",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "brc.id",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05647 | train |
v3 | Schema:
sales (alias: sale)(id, date, amount, salary)
accounts(id, amount, name, type)
Task: Retrieve value from sales with value above the MIN(salary) of accounts rows sharing the same code.
SQL: | SELECT value FROM sales AS sale
WHERE value > (
SELECT MIN(salary) FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05648 | train |
v3 | Schema:
managers (alias: mgr)(id, code, amount, name)
employees(salary, value, id, name)
Task: Retrieve amount from managers with salary above the SUM(value) of employees rows sharing the same code.
SQL: | SELECT amount FROM managers AS mgr
WHERE salary > (
SELECT SUM(value) FROM employees AS emp
WHERE emp.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05649 | train |
v3 | Schema:
categories (alias: catg)(value, code, salary, level)
projects(level, code, value, name)
Task: Find value from categories where salary exceeds the maximum amount from projects for the same type.
SQL: | SELECT value FROM categories AS catg
WHERE salary > (
SELECT MAX(amount) FROM projects AS prj
WHERE prj.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05650 | train |
v3 | Schema:
managers (alias: mgr)(code, value, salary, level)
branches(type, status, value, code)
Task: Retrieve amount from managers with value above the MIN(value) of branches rows sharing the same status.
SQL: | SELECT amount FROM managers AS mgr
WHERE value > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "branches",
"outer_alias": "mgr",
"inner_alias": "brc",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05651 | train |
v1 | Schema:
accounts (alias: acct)(id, date, name, code)
orders(type, value, salary, level)
Task: Retrieve amount from accounts whose status is found in orders rows where level matches the outer record.
SQL: | SELECT amount FROM accounts AS acct
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "orders",
"outer_alias": "acct",
"inner_alias": "ord",
"proj_col": "amount",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05652 | train |
v3 | Schema:
products (alias: prod)(amount, type, name, id)
departments(name, level, salary, id)
Task: Retrieve value from products with amount above the MIN(salary) of departments rows sharing the same status.
SQL: | SELECT value FROM products AS prod
WHERE amount > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.status = prod.status
); | {
"outer_table": "products",
"inner_table": "departments",
"outer_alias": "prod",
"inner_alias": "dept",
"proj_col": "value",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05653 | train |
v2 | Schema:
requests (alias: ordr)(name, id, code, value)
customers(name, value, date, salary)
Task: Find value from requests where a matching record exists in customers with the same status.
SQL: | SELECT value FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.status = ordr.status
); | {
"outer_table": "requests",
"inner_table": "customers",
"outer_alias": "ordr",
"inner_alias": "cust",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "ordr.status",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05654 | train |
v2 | Schema:
branches (alias: brc)(code, id, type, date)
employees(amount, date, status, salary)
Task: Find amount from branches where a matching record exists in employees with the same code.
SQL: | SELECT amount FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05655 | train |
v2 | Schema:
managers (alias: mgr)(amount, type, value, code)
employees(salary, value, level, status)
Task: Retrieve name from managers that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT name FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "employees",
"outer_alias": "mgr",
"inner_alias": "emp",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05656 | train |
v3 | Schema:
branches (alias: brc)(salary, date, type, value)
categories(status, salary, date, type)
Task: Find name from branches where salary exceeds the average salary from categories for the same status.
SQL: | SELECT name FROM branches AS brc
WHERE salary > (
SELECT AVG(salary) FROM categories AS catg
WHERE catg.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "categories",
"outer_alias": "brc",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05657 | train |
v2 | Schema:
accounts (alias: acct)(type, code, value, date)
schedules(type, value, level, status)
Task: Retrieve amount from accounts that have at least one corresponding entry in schedules sharing the same level.
SQL: | SELECT amount FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.level = acct.level
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "acct.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05658 | train |
v3 | Schema:
projects (alias: prj)(status, type, value, name)
branches(status, salary, code, level)
Task: Retrieve salary from projects with amount above the MIN(value) of branches rows sharing the same id.
SQL: | SELECT salary FROM projects AS prj
WHERE amount > (
SELECT MIN(value) FROM branches AS brc
WHERE brc.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "branches",
"outer_alias": "prj",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05659 | train |
v2 | Schema:
orders (alias: ord)(salary, id, status, date)
customers(id, name, level, date)
Task: Retrieve code from orders that have at least one corresponding entry in customers sharing the same code.
SQL: | SELECT code FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "customers",
"outer_alias": "ord",
"inner_alias": "cust",
"proj_col": "code",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05660 | train |
v1 | Schema:
products (alias: prod)(salary, amount, code, level)
orders(date, id, salary, code)
Task: Retrieve salary from products whose id is found in orders rows where type matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE id IN (
SELECT id FROM orders AS ord
WHERE ord.type = prod.type
); | {
"outer_table": "products",
"inner_table": "orders",
"outer_alias": "prod",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05661 | train |
v1 | Schema:
invoices (alias: inv)(name, salary, status, value)
branches(status, value, date, level)
Task: Retrieve salary from invoices whose status is found in branches rows where level matches the outer record.
SQL: | SELECT salary FROM invoices AS inv
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "branches",
"outer_alias": "inv",
"inner_alias": "brc",
"proj_col": "salary",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05662 | train |
v2 | Schema:
departments (alias: dept)(id, code, status, salary)
customers(level, name, salary, status)
Task: Find salary from departments where a matching record exists in customers with the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM customers AS cust
WHERE cust.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05663 | train |
v2 | Schema:
orders (alias: ord)(code, salary, type, amount)
categories(salary, id, amount, date)
Task: Find id from orders where a matching record exists in categories with the same code.
SQL: | SELECT id FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05664 | train |
v2 | Schema:
tasks (alias: tsk)(salary, amount, id, date)
projects(date, amount, id, salary)
Task: Find name from tasks where a matching record exists in projects with the same id.
SQL: | SELECT name FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = tsk.id
); | {
"outer_table": "tasks",
"inner_table": "projects",
"outer_alias": "tsk",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "tsk.id",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05665 | train |
v1 | Schema:
transactions (alias: txn)(code, level, type, date)
orders(id, level, date, type)
Task: Retrieve salary from transactions whose status is found in orders rows where id matches the outer record.
SQL: | SELECT salary FROM transactions AS txn
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "orders",
"outer_alias": "txn",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05666 | train |
v2 | Schema:
transactions (alias: txn)(date, name, status, code)
schedules(type, level, code, salary)
Task: Find amount from transactions where a matching record exists in schedules with the same id.
SQL: | SELECT amount FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = txn.id
); | {
"outer_table": "transactions",
"inner_table": "schedules",
"outer_alias": "txn",
"inner_alias": "schd",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "txn.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05667 | train |
v1 | Schema:
products (alias: prod)(salary, date, id, type)
requests(salary, type, name, code)
Task: Find id from products where level appears in requests entries with matching code.
SQL: | SELECT id FROM products AS prod
WHERE level IN (
SELECT level FROM requests AS ordr
WHERE ordr.code = prod.code
); | {
"outer_table": "products",
"inner_table": "requests",
"outer_alias": "prod",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "level",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05668 | train |
v1 | Schema:
invoices (alias: inv)(name, date, amount, value)
items(value, code, salary, name)
Task: Select id from invoices where id exists in items for the same id.
SQL: | SELECT id FROM invoices AS inv
WHERE id IN (
SELECT id FROM items AS lne
WHERE lne.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05669 | train |
v3 | Schema:
shipments (alias: shp)(id, date, code, name)
branches(code, status, value, amount)
Task: Retrieve code from shipments with salary above the COUNT(amount) of branches rows sharing the same code.
SQL: | SELECT code FROM shipments AS shp
WHERE salary > (
SELECT COUNT(amount) FROM branches AS brc
WHERE brc.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05670 | train |
v2 | Schema:
managers (alias: mgr)(salary, amount, status, code)
products(value, type, level, date)
Task: Find id from managers where a matching record exists in products with the same level.
SQL: | SELECT id FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05671 | train |
v2 | Schema:
categories (alias: catg)(level, status, amount, id)
projects(id, salary, amount, level)
Task: Find id from categories where a matching record exists in projects with the same level.
SQL: | SELECT id FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "projects",
"outer_alias": "catg",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05672 | train |
v3 | Schema:
requests (alias: ordr)(date, amount, status, id)
accounts(value, salary, code, status)
Task: Find amount from requests where salary exceeds the total amount from accounts for the same type.
SQL: | SELECT amount FROM requests AS ordr
WHERE salary > (
SELECT SUM(amount) FROM accounts AS acct
WHERE acct.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "accounts",
"outer_alias": "ordr",
"inner_alias": "acct",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05673 | train |
v1 | Schema:
employees (alias: emp)(type, date, value, id)
projects(code, name, salary, id)
Task: Retrieve code from employees whose id is found in projects rows where id matches the outer record.
SQL: | SELECT code FROM employees AS emp
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "code",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05674 | train |
v3 | Schema:
managers (alias: mgr)(name, code, id, salary)
products(salary, date, status, level)
Task: Find name from managers where value exceeds the maximum value from products for the same status.
SQL: | SELECT name FROM managers AS mgr
WHERE value > (
SELECT MAX(value) FROM products AS prod
WHERE prod.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "products",
"outer_alias": "mgr",
"inner_alias": "prod",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05675 | train |
v2 | Schema:
requests (alias: ordr)(date, value, level, amount)
employees(type, amount, level, code)
Task: Retrieve code from requests that have at least one corresponding entry in employees sharing the same id.
SQL: | SELECT code FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.id = ordr.id
); | {
"outer_table": "requests",
"inner_table": "employees",
"outer_alias": "ordr",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "ordr.id",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05676 | train |
v2 | Schema:
sales (alias: sale)(code, salary, type, name)
staff(value, name, amount, type)
Task: Retrieve id from sales that have at least one corresponding entry in staff sharing the same code.
SQL: | SELECT id FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "staff",
"outer_alias": "sale",
"inner_alias": "empl",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05677 | train |
v3 | Schema:
managers (alias: mgr)(code, id, date, level)
sales(id, status, date, code)
Task: Find amount from managers where amount exceeds the maximum amount from sales for the same id.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT MAX(amount) FROM sales AS sale
WHERE sale.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05678 | train |
v2 | Schema:
managers (alias: mgr)(name, id, amount, date)
sales(name, salary, code, level)
Task: Retrieve value from managers that have at least one corresponding entry in sales sharing the same status.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "sales",
"outer_alias": "mgr",
"inner_alias": "sale",
"proj_col": "value",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05679 | train |
v3 | Schema:
regions (alias: rgn)(level, name, value, id)
accounts(status, amount, name, id)
Task: Find code from regions where salary exceeds the count of salary from accounts for the same code.
SQL: | SELECT code FROM regions AS rgn
WHERE salary > (
SELECT COUNT(salary) FROM accounts AS acct
WHERE acct.code = rgn.code
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "rgn.code",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05680 | train |
v3 | Schema:
managers (alias: mgr)(id, amount, type, status)
requests(amount, name, salary, type)
Task: Find id from managers where value exceeds the count of salary from requests for the same code.
SQL: | SELECT id FROM managers AS mgr
WHERE value > (
SELECT COUNT(salary) FROM requests AS ordr
WHERE ordr.code = mgr.code
); | {
"outer_table": "managers",
"inner_table": "requests",
"outer_alias": "mgr",
"inner_alias": "ordr",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "mgr.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05681 | train |
v2 | Schema:
branches (alias: brc)(type, name, salary, value)
items(salary, type, date, amount)
Task: Find id from branches where a matching record exists in items with the same level.
SQL: | SELECT id FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05682 | train |
v2 | Schema:
accounts (alias: acct)(name, level, value, amount)
items(value, level, salary, date)
Task: Find code from accounts where a matching record exists in items with the same status.
SQL: | SELECT code FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.status = acct.status
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "acct.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05683 | train |
v3 | Schema:
departments (alias: dept)(level, amount, date, type)
customers(date, level, salary, status)
Task: Find salary from departments where amount exceeds the total salary from customers for the same id.
SQL: | SELECT salary FROM departments AS dept
WHERE amount > (
SELECT SUM(salary) FROM customers AS cust
WHERE cust.id = dept.id
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "dept.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05684 | train |
v3 | Schema:
transactions (alias: txn)(name, date, level, salary)
requests(name, code, value, amount)
Task: Find code from transactions where amount exceeds the minimum amount from requests for the same type.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MIN(amount) FROM requests AS ordr
WHERE ordr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05685 | train |
v3 | Schema:
managers (alias: mgr)(date, code, name, value)
schedules(value, salary, code, amount)
Task: Retrieve salary from managers with value above the SUM(amount) of schedules rows sharing the same level.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT SUM(amount) FROM schedules AS schd
WHERE schd.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05686 | train |
v1 | Schema:
requests (alias: ordr)(salary, name, amount, value)
schedules(type, name, status, amount)
Task: Retrieve salary from requests whose id is found in schedules rows where code matches the outer record.
SQL: | SELECT salary FROM requests AS ordr
WHERE id IN (
SELECT id FROM schedules AS schd
WHERE schd.code = ordr.code
); | {
"outer_table": "requests",
"inner_table": "schedules",
"outer_alias": "ordr",
"inner_alias": "schd",
"proj_col": "salary",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "ordr.code",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05687 | train |
v2 | Schema:
sales (alias: sale)(status, value, type, code)
requests(code, name, value, status)
Task: Retrieve salary from sales that have at least one corresponding entry in requests sharing the same level.
SQL: | SELECT salary FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM requests AS ordr
WHERE ordr.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "requests",
"outer_alias": "sale",
"inner_alias": "ordr",
"proj_col": "salary",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05688 | train |
v3 | Schema:
employees (alias: emp)(value, type, id, amount)
invoices(name, value, type, status)
Task: Find salary from employees where value exceeds the minimum salary from invoices for the same code.
SQL: | SELECT salary FROM employees AS emp
WHERE value > (
SELECT MIN(salary) FROM invoices AS inv
WHERE inv.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "invoices",
"outer_alias": "emp",
"inner_alias": "inv",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05689 | train |
v3 | Schema:
projects (alias: prj)(salary, value, amount, date)
departments(value, level, salary, date)
Task: Retrieve name from projects with amount above the MIN(salary) of departments rows sharing the same level.
SQL: | SELECT name FROM projects AS prj
WHERE amount > (
SELECT MIN(salary) FROM departments AS dept
WHERE dept.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05690 | train |
v3 | Schema:
requests (alias: ordr)(status, salary, type, id)
branches(code, date, status, id)
Task: Find code from requests where amount exceeds the maximum salary from branches for the same level.
SQL: | SELECT code FROM requests AS ordr
WHERE amount > (
SELECT MAX(salary) FROM branches AS brc
WHERE brc.level = ordr.level
); | {
"outer_table": "requests",
"inner_table": "branches",
"outer_alias": "ordr",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ordr.level",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05691 | train |
v2 | Schema:
invoices (alias: inv)(amount, code, type, date)
transactions(type, id, amount, salary)
Task: Find amount from invoices where a matching record exists in transactions with the same id.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "transactions",
"outer_alias": "inv",
"inner_alias": "txn",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05692 | train |
v2 | Schema:
orders (alias: ord)(status, id, value, name)
staff(value, status, code, salary)
Task: Retrieve salary from orders that have at least one corresponding entry in staff sharing the same type.
SQL: | SELECT salary FROM orders AS ord
WHERE EXISTS (
SELECT 1 FROM staff AS empl
WHERE empl.type = ord.type
); | {
"outer_table": "orders",
"inner_table": "staff",
"outer_alias": "ord",
"inner_alias": "empl",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ord.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05693 | train |
v3 | Schema:
managers (alias: mgr)(name, id, type, status)
categories(type, name, amount, code)
Task: Find id from managers where amount exceeds the average amount from categories for the same id.
SQL: | SELECT id FROM managers AS mgr
WHERE amount > (
SELECT AVG(amount) FROM categories AS catg
WHERE catg.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "AVG",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05694 | train |
v2 | Schema:
products (alias: prod)(salary, level, code, amount)
accounts(status, level, amount, type)
Task: Find id from products where a matching record exists in accounts with the same level.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.level = prod.level
); | {
"outer_table": "products",
"inner_table": "accounts",
"outer_alias": "prod",
"inner_alias": "acct",
"proj_col": "id",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05695 | train |
v2 | Schema:
categories (alias: catg)(value, salary, id, date)
schedules(date, amount, level, name)
Task: Retrieve name from categories that have at least one corresponding entry in schedules sharing the same status.
SQL: | SELECT name FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.status = catg.status
); | {
"outer_table": "categories",
"inner_table": "schedules",
"outer_alias": "catg",
"inner_alias": "schd",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "catg.status",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05696 | train |
v2 | Schema:
requests (alias: ordr)(salary, code, level, value)
regions(code, id, type, value)
Task: Retrieve salary from requests that have at least one corresponding entry in regions sharing the same type.
SQL: | SELECT salary FROM requests AS ordr
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.type = ordr.type
); | {
"outer_table": "requests",
"inner_table": "regions",
"outer_alias": "ordr",
"inner_alias": "rgn",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "ordr.type",
"token_group": "T2",
"fan_out": 95
} | T2 | cs8_fixed_v4_train_05697 | train |
v3 | Schema:
branches (alias: brc)(code, date, value, amount)
employees(code, id, date, level)
Task: Retrieve id from branches with salary above the MAX(salary) of employees rows sharing the same level.
SQL: | SELECT id FROM branches AS brc
WHERE salary > (
SELECT MAX(salary) FROM employees AS emp
WHERE emp.level = brc.level
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "brc.level",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05698 | train |
v2 | Schema:
transactions (alias: txn)(id, salary, name, level)
managers(id, status, code, date)
Task: Retrieve salary from transactions that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT salary FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = txn.type
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "salary",
"join_col": "type",
"correlated_ref": "txn.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05699 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.