1. Konrad Rymczak
  2. htsql-firebird


Kirill Simonov  committed 9911e39

Updated Introduction.

  • Participants
  • Parent commits 82f4eb7
  • Branches default
  • Tags 2.2.1

Comments (0)

Files changed (1)

File doc/introduction.rst

View file
  • Ignore whitespace
 selection.  The linking is implicit, and correct.  The encoded query can
 be read aloud as a verbal inquiry.
 SQL Conflates Filters & Links
 and the row definition separate from output columns.  The query adheres
 the form of the original business inquiry.
 Conflating Projection with Aggregation
 is indicated separately as part of the column selector rather than being
 conflated with the row definition.
 SQL Lacks Means of Encapsulation
     *"For each department, return the department name and the number of
     offered 100's, 200's, 300's and 400's courses."*
-In this business inquiry, we are asked to evaluate the same statistic 
+In this business inquiry, we are asked to evaluate the same statistic
 across multiple ranges.
 .. sourcecode:: sql
 attribute ``count_courses($level)`` on the ``department`` table and
 then evaluating it for each course level.
 In SQL, Modest Complexity is Painful
     - associated courses with credits>3
 .. sourcecode:: sql
     SELECT s.name, o.avg_over_3
 semantics.  For a more incremental approach, please read the
 Scalar Expressions
 .. htsql:: /(7<13)&(1=0|1!=0)
 * for each ``school`` record, ``department`` generates
   associated ``department`` records;
 .. htsql:: /school.limit(2)
 Selection & Definition
    /define($avg_credits := avg(course.credits))
     .course{title, credits}?credits>$avg_credits
 .. htsql:: /school^campus {campus, count(school)}
 Even though HTSQL provides automatic links inferred from foreign key
 constraints, arbitrary linking is also allowed:
-.. htsql:: /school.({code} -> department{school_code})
+.. htsql::
    :cut: 4
-This query uses a linking operator to replicate an automatic link:
-.. htsql:: /school.department
-   :cut: 4
-   :hide:
-Forking operator links a table to itself by the given expression:
-.. htsql::
-   /school{name, campus}
-          ?count(department)>avg(fork(campus).count(department))
+   /school{name, count(department)}
+          ?count(department)>avg(@school.count(department))
 This query returns schools with the number of departments above average
-among all schools in the same campus.  Using a linking operator, this
-query could be written as:
-.. htsql::
-   :hide:
-   /school{name, campus}
-          ?count(department)>avg((campus -> school).count(department))
+among all schools.
 What's up Next?
 We intend to add to HTSQL many more features in the future.
-Currently, the HTSQL processor is not quite user friendly.  In the next
-major release we will focus on filling these gaps:
-* helpful error messages 
-* ability to list tables & columns
-* syntax highlighting & completion
-* installers & deployment documentation 
 Hierarchical Output
 This query is to generate a tree-shaped output: for each school, it
-produces the school name, a list of titles of associated programs, 
+produces the school name, a list of titles of associated programs,
 and a list of names of associated departments.
 Analytical Processing