Ideally, you should have some level of experience in SQL coding if you want to hand code. This means you first get mysql-server (click-to-install)
For the most basic sql commands, you would need to install
mysql-client as well. After that open a terminal and run
mysql -u username -p for running mysql cli. Take a look at mysql documentation for learning mysql.
According to the open-office wiki, Openoffice Base is also integratable with mysql. Take a look here for more instructions. There are other mysql-gui tools available for ubuntu, the most recommended being Squirrelsql. For the export part to csv, I believe Openoffice should be capable of that (I have no experience of using Base)
In case you would like a web based interface, I would recommend phpmyadmin and sqlbuddy as two possible options. They can connect to external servers as well. So you can run them on other machines as well