This document describes the HTSQL language. We start with describing the syntax of HTSQL, then we discuss the HTSQL data model, query semantics and naming scopes, and conclude with a reference of HTSQL data types, functions and operators.