Instructions for RTA

Access This link (Download) and get RTA.zip, and execute the following commands.

$ cd (Downloaded Directory)
$ unzip RTA.zip
$ cd RTA
$ bin/rta_setup

Then, a configuration file .rta is created in your home directory and alias rta is written in your .bashrc.
If the alias isn't written, edit .bashrc manually as follows.

$ vi ~/.bashrc

~
alias rta='(Downloaded Directory)/RTA/bin/rta'

$ source ~/.bashrc

Edit file .rta as below to configure RTA.

$ vi ~/.rta

driver=mysql        // (mysql | postgresql)
host=localhost      
user=user           
password=password
db=dbname           // Local database name to use as local
tmp_db=tmp          // Tmp database name to save result table

After this, command rta will work. Input your RTA query. RTA query must end with ; like normal SQL.

$ rta
rta> (Input RTA query)

Example)

$ rta
rta> SELECT u.id, u.name, u.postal_code, p.prefecture_name, p.city_name, p.address
  -> FROM users u, #postal_code p
  -> WHERE u.postal_code = p.code;

If you want to quit RTA, enter \q.

rta> \q
$

If you want to try RTA instantly, you can download and insert these sample tables and execute following queries.

MySQL Version / PostgreSQL Version

SQL 1
SELECT u.id, u.name, u.postal_code, p.prefecture_name, p.city_name, p.address
FROM users u, #postal_code p
WHERE u.postal_code = p.code;
SQL 2
SELECT u.id, u.name, SUM (us.number * s.ending_price)
FROM users u, user_stocks us, #stocks s
WHERE u.id = us.user_id AND us.code = s.code GROUP BY u.id, u.name;

And other many queries!

If you want to register your own table to PTL, access Resiter Page and input your table info. To register miltiple tables at once input tables separated by commas like "table1,table2,...". Please don't register writable DB user, but readonly user.

Table Registration

If inputed table is available, input addituinal info(Table escription, Each column Descriptions) to the next page. You normaly don't need to edit "Access Name". Column Registration