Agent skill · data analytics · datadrivenconstruction

sql-query-builder

Build SQL queries for construction databases. Generate optimized SQL queries for construction data retrieval

Why this skill is useful

Generates optimized SQL queries tailored for construction data retrieval, which the AI wouldn't reliably create on its own.

What it needs

Requires python3 installed locally. About 7k tokens when loaded. Last updated 2026-02-14. 265 stars on the source repository.

What this skill does

SQL Query Builder Overview Based on DDC methodology (Chapter 2.1), this skill builds SQL queries for construction databases, supporting common construction data patterns like cost tracking, schedule management, and resource allocation. Book Reference: "Типы данных в строительстве" / "Data Types in Construction" Quick Start `python from dataclasses import dataclass, field from enum import Enum from typing import List, Dict, Optional, Any, Union from datetime import datetime, date class QueryType(Enum): """Types of SQL queries""" SELECT = "select" INSERT = "insert" UPDATE = "update" DELETE = "delete" AGGREGATE = "aggregate" JOIN = "join" class AggregateFunction(Enum): """SQL aggregate functions""" SUM = "SUM" AVG = "AVG" COUNT = "COUNT" MIN = "MIN" MAX = "MAX" GROUPCONCAT = "GROUPCONCAT" class JoinType(Enum): """SQL join types""" INNER = "INNER JOIN" LEFT = "LEFT JOIN" RIGHT = "RIGHT JOIN" FULL = "FULL OUTER JOIN" class ComparisonOperator(Enum): """Comparison operators""" EQ = "=" NE = "<>" GT = ">" GE = ">=" LT = "<" LE = "<=" LIKE = "LIKE" IN = "IN" BETWEEN = "BETWEEN" ISNULL = "IS NULL" ISNOTNULL = "IS NOT NULL" @dataclass class WhereCondition: """SQL WHERE condition""" column: str operator: ComparisonOperator value: Any tablealias: Optional[str] = None def tosql(self) -> str: col = f"{self.tablealias}.{self.column}" if self.tablealias else self.column if self.operator == ComparisonOperator.ISNULL: return f"{col} IS NULL" elif self.operator == ComparisonOperator.ISNOTNULL: return f"{col} IS NOT NULL" elif self.operator == ComparisonOperator.IN: values = ", ".join(f"'{v}'" if isinstance(v, str) else str(v) for v in self.value) return f"{col} IN ({values})" elif self.operator == ComparisonOperator.BETWEEN: return f"{col} BETWEEN {self.formatvalue(self.value[0])} AND {self.formatvalue(self.value[1])}" elif self.operator == ComparisonOperator.LIKE: return f"{col} LIKE '{self.value}'" else: return f"{col} {self.operator.value} {self.formatvalue(self.value)}" def formatv …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills datadrivenconstruction/sql-query-builder

View the source on GitHub

Browse the @skills marketplace