6dfgs logo
* DR3 now active *
Database Home
Database Schema
FITS files
Database Access
Menu | SQL | Xmatch
6dFGS main
AAO 6dF pages
AAO Home

Introduction to using the form

The menu driven 6dFGS form parses your input and generates an SQL query string which is then re-directed to the database. The form and resultant SQL query is case insensitive. A lot of the information on this page is also relevant to the SQL query box form.

Click on the question mark icons (help) by each form field to jump to a help page.

SQL (Structured Query Language) is made up of 3 basic commands: select, from and where . An introductory SQL tutorial can be found here.

Select: in the context of this form the select boxes are used to specify the parameters you wish to extract from the various database tables. The form allows you to query 1 or 2 tables. Enter the names of the parameters you wish to extract from the primary table in the first text box. Names should be separated by commas eg ra,dec,mag_1 entering * returns all parameters for that table. If querying a second table enter the parameter names, again separated by commas, for that table in the next text box (after the primary table drop down menu).
NB The form interface checks to see if you've selected targetname or specid, if not and then are available from the tables requested and you've requested HTML output they are appended to the select clause as they are used to provide links to the thumnbnails and gif images of the spectra.

The parameters in a given table can be found here.

From: specifies the table(s) you wish to query using the drop down menus marked primary table and secondary table. The next menu allows you to specify a pairing option such that only objects that appear in both tables are returned or whether an object only has to appear in the primary table (referred to as an inner or outer join).

Where: allows you to place conditions on the query. The constraints ( <, =, >= etc) should be separated by logical operators such as and or or eg dec > -20.0 and (ra < 10.0 or ra > 350). Enter your where clause in the box provided. Parameter names such as RA and DEC appear in many tables, when querying two tables ensure any parameters common to both tables in the where box are preceded by the table name and a dot eg hipass.dec > -20.0 and (hipass.ra < 10.0 or hipass.ra > 350). Coordinates should be specified in decimal degrees. The menu driven form also allows the user to specify a radial search by taking the values entered for the search radius (in arcmin) and the RA and DEC plus Equinox of the search centre. These values are wrapped up in a function which is then added to the query. The radial search will not return objects with targetid=0 i.e. objects that have not been paired with the sources in the master TARGET configuration file.

Order by: if you want to sort your output on a given parameter than enter its name in the text box provided, you can also specify asc (ascending, the default) or desc (descending). If querying two tables you might need to precede the parameter(s) with the relevant table name and a dot to uniquely specify it as some tables share the same names for parameters. eg twomass.ra desc. To sort on more than one parameter separate the clauses with commas eg spectra.targetid asc, spectra.quality desc

The remainder of the form is concerned with specifying what output is generated.

The default is to output RAs and DECs in sexagesimal format unless you check the box provided.

NROWS: enter the maximum number of rows returned in any HTML table. There is a hard-wired maximum of 100 as HTML tables are only really useful if the user is able to take-in the data by eye. If you want more rows you'll need to select CSV output and download the file. Be warned Netscape on Unix struggles with large HTML tables so reduce the load by only outputting the columns/rows you need.

Data format: select HTML or a comma-separated value (CSV) file. If CSV is selected ALL rows returned by the query are written to the CSV file. Selecting * from TWOMASS will generate a CSV with more than 100,000 rows and some 70Mb in size. Again reduce the size by thinking about your query and what parameters you need.

CSV compression: Do you wish the CSV file to be gzipped?

TAR: If you select yes, then the query is performed and a link to a TAR saveset of FITS files matching the returned objects is output to the browser after the HTML summary table. Note the number of rows written to the CSV and the resultant implications for the size of the TAR file. The size of the TAR file has been limited to 500 FITS files. NB you must specify CSV as the data format and provide a valid email address.

Home | Intro | Schema | Access | FITS files

WFAU, Institute for Astronomy,
Royal Observatory, Blackford Hill
Edinburgh, EH9 3HJ, UK
Tel +44 131 668 8356 (office)
or +44 131 668 8100 (switchboard)