RA is a simple relational algebra interpreter, with full documentation at the public RA website. It has already been installed on your VM, and customized for this course to run on databases managed by the PostgreSQL server running on your VM.
To create/restore the example
beers database in PostgreSQL (used as a running example on the public RA website), run “
/opt/dbcourse/examples/db-beers/setup.sh” from your VM shell. Then, you can connect RA to your
beers database by issuing the following command:
(If you have a different database to connect to, just replace
beers above with the database name.)
Warning: If you want to follow the RA example queries on the public website above, beware that tables in your PostgreSQL database are all lower-case (as opposed to capitalized), so make sure you make table names in your RA queries lower-case (e.g.,
Check out “Advance Usage” for more information. In particular, here are some useful tips:
radbwith the verbose option
-vwill print extra information helpful for debugging your query.
- Are your queries getting too complicated, and would you rather like to think/write in steps? Use RA views.
- Do you need to get away from RA for a while without losing your work so far? You can save your views into a file and restore them later when you restart RA; see “Views” and “Other Features” for details.
- By default RA starts in an interactive mode, but you can run RA in a non-interactive mode instead, where it will read commands from an input file and write the result to an output file:
radb dbname -i inputfile.txt > -eo outputfile.txt