Commits

Kirill Simonov  committed 03b6b63

Removed `EXAMPLES` file; added a link to the website instead.

  • Participants
  • Parent commits fa0dd99

Comments (0)

Files changed (4)

File EXAMPLES

-Examples
-========
-
-HTSQL provides outstanding clarity without sacrificing rigor.  Not only
-is working with HTSQL more productive than SQL, but things are possible
-that may have otherwise exceeded a user's mental capacity. 
-
-Let's assume we have a data model, with schools, departments, programs
-and courses.  Here it is::
-
-         +-------------+       +--------+
-    /---m| DEPARTMENT  |>-----o| SCHOOL |m----\
-    |.   +-------------+  .    +--------+    .|
-    | .                  .                  . |
-    |   department   department    a school   |
-    |   offers       may be part   has one or |
-    |   courses      of school     programs   |
-    |                                         |
-    |    +-------------+       +---------+    |
-    \---<| COURSE      |       | PROGRAM |>---/
-         +-------------+       +---------+
-
-
-List all schools
-----------------
-
-An HTSQL query::
-
-    /school
-
-An equivalent SQL query::
-
-    SELECT code, name
-    FROM ad.school
-    ORDER BY code;
-
-
-Programs ordered by the title
------------------------------
-
-HTSQL::
-
-    /program{title+}
-
-SQL::
-
-    SELECT title
-    FROM ad.program
-    ORDER BY title, school, code;
-
-
-All courses missing a description
----------------------------------
-
-HTSQL::
-
-    /course?!description
-
-SQL::
-
-    SELECT department, number, title, credits, description
-    FROM ad.course
-    WHERE NULLIF(description, '') IS NULL
-    ORDER BY 1, 2;
-
-
-Departments in schools having "art" in its name
------------------------------------------------
-
-HTSQL::
-
-    /department?school.name~'art'
-
-SQL::
-
-    SELECT d.code, d.name, d.school
-    FROM ad.department AS d
-    LEFT OUTER JOIN
-         ad.school AS s ON (d.school = s.code)
-    WHERE s.name ILIKE '%art%'
-    ORDER BY 1;
-
-
-The number of schools
----------------------
-
-HTSQL::
-
-    /count(school)
-
-SQL::
-
-    SELECT COUNT(TRUE)
-    FROM ad.school;
-
-
-Schools with programs
----------------------
-
-HTSQL::
-
-    /school?exists(program)
-
-SQL::
-
-    SELECT s.code, s.name
-    FROM ad.school AS s
-    WHERE EXISTS(SELECT TRUE
-                 FROM ad.program AS p
-                 WHERE s.code = p.school)
-    ORDER BY 1;
-
-
-The number of schools with programs
------------------------------------
-
-HTSQL::
-
-    /count(school?exists(program))
-
-SQL::
-
-    SELECT COUNT(TRUE)
-    FROM ad.school AS s
-    WHERE EXISTS(SELECT TRUE
-                 FROM ad.program AS p
-                 WHERE (s.code = p.school));
-
-
-Number of programs and departments per school
----------------------------------------------
-
-HTSQL::
-
-    /school{name, count(program), count(department)}
-
-SQL::
-
-    SELECT s.name, COALESCE(p.cnt, 0), COALESCE(d.cnt, 0)
-    FROM ad.school AS s
-    LEFT OUTER JOIN
-         (SELECT COUNT(TRUE) AS cnt, p.school
-          FROM ad.program AS p
-          GROUP BY 2) AS p ON (s.code = p.school)
-    LEFT OUTER JOIN
-         (SELECT COUNT(TRUE) AS cnt, d.school
-          FROM ad.department AS d
-          GROUP BY 2) AS d ON (s.code = d.school)
-    ORDER BY s.code;
-
-
-Average number of courses offered by departments in each school
----------------------------------------------------------------
-
-HTSQL::
-
-    /school{name, avg(department.count(course))}
-
-SQL::
-
-    SELECT s.name, d.av
-    FROM ad.school AS s
-    LEFT OUTER JOIN
-         (SELECT AVG(CAST(COALESCE(c.cnt, 0) AS NUMERIC)) AS av, d.school
-          FROM ad.department AS d
-          LEFT OUTER JOIN
-               (SELECT COUNT(TRUE) AS cnt, c.department
-               FROM ad.course AS c
-               GROUP BY 2) AS c ON (d.code = c.department)
-          GROUP BY 2) AS d ON (s.code = d.school)
-    ORDER BY s.code;
-
 # included to the source distribution.
 
 # README files.
-include README INSTALL EXAMPLES NEWS LICENSE
+include README INSTALL NEWS LICENSE
 
 # Makefile files.
 include Makefile Makefile.common Makefile.env.sample
     http://htsql.org/
         The HTSQL homepage
 
+    http://htsql.org/doc/examples.html
+        Examples of HTSQL syntax
+
     http://htsql.org/doc/tutorial.html
         The HTSQL tutorial
 
 from setuptools import setup, find_packages
 import os.path
 
-# We use the merged content of `README`, `EXAMPLES` and `NEWS` as the
+# We use the merged content of `README` and `NEWS` as the
 # long description of the package.
 
 root = os.path.dirname(__file__)
 README = open(os.path.join(root, 'README')).read()
-EXAMPLES = open(os.path.join(root, 'EXAMPLES')).read()
 NEWS = open(os.path.join(root, 'NEWS')).read()
 
 # The distutils parameters are defined here.  Do not forget to update
 NAME = "HTSQL"
 VERSION = "2.0.0b3"
 DESCRIPTION = "Query language for the accidental programmer"
-LONG_DESCRIPTION = "\n".join([README, EXAMPLES, NEWS])
+LONG_DESCRIPTION = "\n".join([README, NEWS])
 AUTHOR = "Clark C. Evans and Kirill Simonov; Prometheus Research, LLC"
 AUTHOR_EMAIL = "cce@clarkevans.com"
 LICENSE = "Free To Use But Restricted"