The main objective of this application is to provide a tool for converting a relational calculus query to SQL query and execute it on a database. This application helps serve students build realtional queries and execute them to verify their corectness.

MySQL Installation (Required to run SQL queries)

1) Download and install MySQL. MySQL download

Steps To Install MySql

1) Download the MySQL Community Server from the download page. 2) Select defaults on installation. 3) On finishing installation make sure "Launch the MySQL Instance Configuration Wizard" is checked and click Finish. 4) In the configuration wizard, chose the "Standard Configuration". 5) When configuring ensure that the Bin directory is added to the PATH environment variable. 6) Also, during configuration set the root password as "root" (used as the default settings for the database connection in the application). 2) Create a database

Steps to create the database

1) Run mysql on the command line by typing "mysql -uroot -proot" 2) At the mysql prompt, type "create database relcalc;" 3) Quit mysql by typing "exit" 3) To create the tables used by the application (required to run the examples in the application), download the file relcalcdump.sql (right click on the link and use "Save Link As..."). Now from the command line, navigate to where the relcalcDump.sql file is. Then type "mysqldump -uroot -proot relcalc < relcalcdump.sql". 4) Check if the tables are created: From the command line start mysql by typing "mysql -uroot -proot". Then at the mysql prompt type "use relcalc;". Now type "show tables;". If the tables are listed, everything went well. If the result is an "Empty set", then open the relcalcDump.sql file in notepad, copy its contents and paste it into the commandline with the mysql prompt. This should create the tables required to run the examples in the application.

How to use the application

1) Run the file relcalc.jar
2) Connect to the database by navigating to:  Database --> Connect database.
3) A dialog box opens up. Select the "Use Defaults" and click Connect.
4) After the connection is successful, close the connection dialog box. The tables will be displayed in the left column as seen below.

5) For syntax, example queries are provided in the Help section of the menu.
6) There are 2 buttons on the right side “Translate” and “Run”. When you click Translate, the relational query is converted into SQL and displayed in the 2nd 
text area. When you click Run, the SQL query is executed and the result is displayed in the table below the 2nd text area.
7) To hide/unhide the toolbar that contains the greek characters use the view menu.

Relational Calculus Emulator Download

To download the executable for the application click here:
1) Click the link "relcalc.jar" to download the application.
2) Choose the location for saving the file (ex: Desktop or My Documents/Downloads).
3) Go to the location where the file is saved and double click the relcal.jar file.
4) Pre-requisite for running the application is:
	1) Have JAVA installed.
	2) MySQL installed and database created using the steps for creating the database.

To download the source, get the zip file: Relational Calculus