Request for clarification

From: Kona Andrews <kea-at-ast.cam.ac.uk>
Date: Mon, 28 Nov 2005 16:35:55 +0000 (GMT)


Hi there,

I'm looking at the latest (to my knowledge) ADQL working document, v1.01, ADQL-20050624-1.doc, and I'm seeking some clarification of a couple of points.

I note the following:



3.2.1 Aliases

All table names in ADQL MUST have an alias. Aliasing tables is a part of standard SQL, but we are enforcing this in ADQL/s. This means queries in ADQL/s must take the form

 Select * from table t

  This makes substitution of table names much easier as it must be done in   only one place to change the alias.


Question 1 -
I am inferring from the above that in *any* ADQL query, it is necessary to declare an alias for each and every table referenced in that query - is that correct? In other words, the unambiguous query "select ra,dec from mytable" is invalid ADQL because it lacks an alias declaration for mytable?

Question 2 -
As I understand it, SQL uses the syntax "from table as t" rather than "from table t" when declaring aliases. Am I incorrect here, or if not, should we be including the "as" keyword in our ADQL/s alias declarations?

Question 3 -
If it is compulsory to declare aliases for all tables, is it also compulsory to *use* table alias prefixes for all column references in a query, even when they are otherwise unambiguous?

E.g. the query

  select ra, dec from mytable [as] t where ra > 10;

is unambiguous, but must we nevertheless use explicit table prefixes on our column names like so?:

  select t.ra, t.dec from mytable [as] t where t.ra > 10;

I'd appreciate some clarification on these points.

Many thanks,
Kona Andrews

--
Kona Andrews,  AstroGrid Project  :::   http://www.astrogrid.org
http://wiki.astrogrid.org/bin/view/Main/KonaAndrews
Institute of Astronomy, Madingley Road, Cambridge CB3 0HA
Skype KonaAndrews ::: Ph. +44 (0)774 765 1877 :::  Fax +44 (0)1223 337 523
Received on 2005-11-28Z17:36:44