Quick Guide to the RA Relational Algebra Interpreter


The RA Relational Algebra interpreter, maintained by Prof. Jun Yang at Duke University, is used as the back end for our relational algebra exercises, and has been used in Stanford's Introduction to Databases course for many years. If you'd like to download it and use it offline, here is a guide to help you get started.

First, download ra.jar from the RA website: under the section "Getting RA", follow the link for "Just the .jar file". Also download our zip file of sample.properties, sample.db, and sample.ra, and extract the files into the same directory as ra.jar.

Open the command line for your system, navigate to the directory holding ra.jar, and enter "java -jar ra.jar". (If you get an error that Java is not recognized or can't be found, make sure that Java is installed on your system and that the PATH system variable is properly configured.) You will then be presented with the "ra>" prompt, set up to operate over the same pizza database used in the relational algebra exercises. At the prompt you can enter any RA query over the pizza database -- the only difference from the exercises is a requirement to terminate each query with a semicolon. For instance, type "Person;" to see the contents of the Person table. Don't forget the semicolon!

For more documentation on using RA, including taking query input from a file, writing output to a file, or connecting to a different database, please visit the RA website.