For the command line interface
  - sqlplus guestNN/awcsNN@awdb
    Or, "sqlplus guestNN@awdb" and enter your password when prompted


For the GUI use
oemapp console
  - Pick 'Launch standalone'
  - Add selected databases from your local tnsnames.ora file
    located in /software/oracle/network/admin
  - Click 'OK'
  - Open 'Network', 'Databases', 'AWDB.LC.LEIDENUNIV.NL'
  - Enter Username / Password
  - Click 'OK'

oemapp worksheet
  - Enter Username / Password
  - service = awdb


To set up Python to use the Oracle binding
  - Add the following to ~/.awe/Environment.cfg
    [global]
    database_engine        : oracle_9i
    database_name          : awdb
    database_user          : guestNN
    database_password      : awcsNN
Exercises
  1. Get B.sql and R.sql
    Start the graphical interface.
    Start the command line interface and execute both sql scripts. This will create two tables, bsources and rsources, which you can inspect with the graphical interface. (Look for the schema entry)
  2. In the graphical interface change the value of the smallest magnitude in the bsources table to 5. Use the Show SQL button to find out what the equivalent SQL syntax is to achieve this. In the command line interface delete the rows in the bsources table for which the magnitude is less than 7.
  3. Select the ESO number, NGC number, position, R magnitude and B magnitude joining bsources and rsources once using the ESO number and once using the NGC number. What happens with ESO/NGC numbers that are undefined (NULL)?
  4. Create a view from the selection in the previous example, but additionally include a column in that view that contains B - R.
  5. In Python, do from astro.database.DBMain import DBObject, persistent and create a class with different attribute types and see how they correspond with the Oracle TABLE, VIEW and TYPE of the same name. How can you specify the case of your identifiers in SQL?