SQL Schema

Important announcements

The database for AKARI CAS was restructured into multiple databases. The 'cas' database is available as a new database instead of 'DR1'.
Due to the reconfiguration of the database, the name of some tables and views had changed. If you keep the previously created SQL and want to use again, please do substitution of the name. And also, the usage of some functions had changed.
The correspondence between the new name and the old name is written in Tables and Views. In Functions, please specify the catalogue names ('akari_fis_bsc_1' or 'akari_irc_psc_1') instead of the instrument ('Fis' or 'Irc'). We appreciate in your inconvenience.

The summary is below:

The AKARI FIS and AKARI IRC source catalogs are stored in Tables in the 'cas' Database. Views are defined as special subsets of the original table, however, Tables and Views look the same for the user. The name of Tables or Views can be set after 'FROM' keyword in the SQL statement. The list of columns and their descriptions of Tables and Views are shown in Tables page and Views page.

We prepared a number of Functions for you to use SQL calls efficiently. Functions take some arguments, execute a previously defined sequence of commands, and returns value(s) or table. Their names are prefixed by f, like in fGetNearbyObjCel or fGetObjFromRectCel. The functions can be used after 'SELECT' or 'FROM' keyword in the SQL statement.

The version of catalogs in Tables(Views) differ in databases. However, there is no differences about functions.

Here is an example of SQL call to get 10 object within 50arcmins of a point (ra='12:34:56.999', dec='-65:43:21.111').

SELECT o.*, n.distance
FROM fGetNearbyObjCel('akari_fis_bsc_1', 'j2000',
       fLonStr2Deg('12:34:56.999'), fLatStr2Deg('-65:43:21.111'),
       50) n,
     akari_fis_bsc_1_digest o
WHERE n.objID = o.objID
ORDER BY n.distance

fGetNearbyObjCel() function uses an optimized sequence for the radial search, and returns a table which contains minimum set of columns including objID of found objects. You have to set two numerical values in degree to the 3rd and 4th arguments of this function. But you can also use string expression of 'hh:mm:ss' and 'dd:mm:ss' style by using fLonStr2Deg() and fLatStr2Deg() functions, since they convert a string expression into a numerical value in degree.

Using Functions is the most easy way to obtain the performance/convenience for SQL search. Before writing the SQL call, please read the Function list and search the functions suitable to your request.

Last Modified: 19 November 2018