| Presenter: | Catherine Devlin |
|---|---|
| Date: | March 26th, 2011 |
| Location: | Indiana LinuxFest 2011 |
irc.freenode.net #htsql: Kirill Simonov
This talk does not represent official Dell positions. I don't think Dell even knows I'm giving it...
"How many programs and department does each school have?"
SELECT sch.name,
(SELECT COUNT(1) FROM program
WHERE school = sch.code),
(SELECT COUNT(1) FROM department
WHERE school = sch.code)
FROM school AS sch
ORDER BY sch.code ASC
Written in Python
http://htsql.org/doc/install.html
apt-get install python python-setuptools \
python-yaml python-psycopg2 mercurial
hg clone http://bitbucket.org/prometheus/htsql
cd htsql
make build
make install
htsql-ctl server pgsql://user:pass@host:port/database
An example (E1):
/course{department+, no, credits-, title}
An example (E2):
/department{*, school.name}
For example (E3):
/course?credits<3&department.school='ns'
/course{title, credits, department.name}
/department{name, course.title, course.credits} (No!)
For example (E6):
/course?credits<3&department.school='ns'/:txt
An example (E7):
/department.sort(school).limit(10,5)
/school{code, avg(department.count(course))}
/school{code, avg(department.count(course)) :round 2 :as 'Average courses per department'}
>>> from htsql import HTSQL
>>> from htsql.request import produce
>>> htsql = HTSQL('pgsql:htsql_regress')
>>> with htsql:
... for row in produce('/school'):
... print row
...
HTSQL is quite usable currently, but it may have gaps for a given application. Particular items Prometheus is working on:
Written by Kirill Simonov and Clark Evans (Prometheus Research)
Generous support for HTSQL was provided by Prometheus Research, LLC and The Simons Foundation. This material is also based upon work supported by the National Science Foundation under Grant #0944460.
htsql.com