Configuration options for relational algebra evaluator "ra.jar" I am participating in the Stanford Database Class, and there are some problem sets to be solved in "mathy" relational algebra syntax.

The course instructors demand from students to use this open-source, free jar file "ra.jar"  to submit solutions via web forms.

RA: an interactive relational algebra interpreter
Version 2.1b by Jun Yang (junyang@cs.duke.edu)
&gt;


I wonder if there is a better evaluator available? This one is pretty good but 


on the command-line-interpreter prompt, the cursor position is hard
to see
the tool translates relational alegbra experssions to SQL and submits
them to SQLite. It does not show (return to the user) the
intermediate steps.  There should be a -log or verbose option to
return the SQL generated. (The ra tool has a -v option to return the submitted ra query). 


I want the CREATE VIEW.... and SELECT ... SQL statements that the jar file generates and sends to SQLite. Alternatively, can I configure SQLite to echo/log all sql commands submitted to it? Is there an option for the .properties file?
That RA tool does not have an option to output the SQL queries.

However, the mapping from relational algebra to SQL is pretty much trivial (except for division), can be easily found with a web search, and is something you should have learned in your course.

If you want to find out how RA handles this, look into the file RAXNode.java.
The various classes derived from RAXNode each implement one relational algebra operation; the method toPrintString shows the RA operation, while genViewDef generates the corresponding SQL command.
For example:

public static class PROJECT extends RAXNode {
    public String toPrintString() {
        return "\\project_{" + _columns + "}";
    }
    public String genViewDef(DB db) {
        return "SELECT DISTINCT " + _columns + " FROM " + getChild(0).getViewName();
    }
}
...
public static class INTERSECT extends RAXNode {
    public String toPrintString() {
        return "\\intersect";
    }
    public String genViewDef(DB db) {
        if (db.getDriverName().equals("com.mysql.jdbc.Driver")) {
            // MySQL doesn't support INTERSECT, so we need a workaround.
            ...
        } else {
            return "SELECT * FROM " + getChild(0).getViewName() +
                " INTERSECT SELECT * FROM " + getChild(1).getViewName();
        }
    }
}