Kirill Simonov avatar Kirill Simonov committed 9911e39

Updated Introduction.

Comments (0)

Files changed (1)

doc/introduction.rst

 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
 :doc:`tutorial`.
 
-
 Scalar Expressions
 ------------------
 
 
 .. htsql:: /(7<13)&(1=0|1!=0)
 
-
 Navigation
 ----------
 
 * for each ``school`` record, ``department`` generates
   associated ``department`` records;
 
-
 Filtering
 ---------
 
 
 .. htsql:: /school.limit(2)
 
-
 Selection & Definition
 ----------------------
 
    /define($avg_credits := avg(course.credits))
     .course{title, credits}?credits>$avg_credits
 
-
 Aggregation
 -----------
 
                      sum(course.credits),
                      avg(course.credits)}?exists(course)
 
-
 Projection
 ----------
 
 
 .. htsql:: /school^campus {campus, count(school)}
 
-
 Linking
 -------
 
 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.
 
-Usability
----------
-
-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
 -------------------
 
            /department{name}}
 
 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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.