Statements
                   

Available Datatable

Notice

The charaters comparing in PostgreSQL is case-sensitive, which means class='star' and class='STAR' is not the same. If you want case-insensitive, you could use class ilike 'star'.
pg_Sphere library is available for geometrical search on sphere.

Samples

  • Looking for objects that in the circle with center at (331.7 degree, -1.4degress) and radius=0.2 degree.
    select c.obsid,c.obsdate, c.ra, c.dec, c.z, c.lmjd 
        from catalogue c 
        where spos(c.ra,c.dec) @ scircle '<(331.7d, -1.4d),0.2d>' 
        limit 50
            
  • Given certain condition, query the plan list and the information of center stars
    	
        select obsdate,planid,ra,dec,mjm 
        from plan 
        where obsdate<='2012-12-01' and planid ilike 'GAC%' 
        limit 10
            
  • Query the redshift of galaxies during given time
    select obsdate,planid,spid,fiberid,class,subclass,z 
        from catalogue 
        where obsdate between '20121201' and '20121230' and class ilike 'GALAXY' 
        limit 10
            
  • Query stellar atmosphere parameters under certain condition such as date
    	
        select obsdate,planid,spid,fiberid,rv,logg,feh,teff 
        from stellar 
        where obsdate between '20121201' and '20121230' 
        limit 10
        
  • Query the parameters of F type stars cross-matching between two tables (left connection)
    select a.obsdate,a.planid,a.spid,a.fiberid,b.rv,logg,feh,teff 
        from catalogue as a 
            left join stellar as b on a.obsid=b.obsid 
        where a.class ilike 'STAR' and a.subclass ilike 'F%' 
        limit 10
            
  • Query the parameters of G type stars cross-matching between two tables (fully connected)
    select a.obsdate,a.planid,a.spid,a.fiberid,b.rv,logg,feh,teff 
        from catalogue as a 
            join stellar as b on a.obsid=b.obsid 
        where a.class ilike 'STAR' and a.subclass ilike 'G%' 
        limit 10
            
  • Query the radial velocity and other information of M type stars with H alpha magnetic activity
    select obsdate,planid,spid,fiberid,rv 
        from mstellar 
        where atcha=1 
        limit 10