Before you start
This tutorial introduces new users of IBM Informix 11 to relational database concepts through a fun and interactive game called The Informix Detective Game. The recommended audience is small business owners, students, teachers and professors, or anyone wanting to gain an understanding of data management.
This tutorial assumes that you have no prior knowledge of relational databases or SQL. By completing this tutorial, you will:
- Gain an understanding of database concepts such as tables, rows (records), columns (fields), and values.
- Learn about relational databases, data models, unique keys, primary keys, foreign keys, and table joins.
- Gain a working knowledge of the primary SQL statements:
select,update,insert, anddelete. - Use the Informix command window to import a database.
- Use
dbaccessto create and execute SQL code.
We have included the solution set in a PDF, which you can download from this tutorial.
This tutorial was written assuming you are using Informix Developers Edition running on MS Windows. To play this game, you should have IBM Informix installed, the InformixGame database loaded, and the clue file running.
- If you do not already have Informix 11 installed on your PC, download Informix from the product download Web site.
- Sign in with your IBM ID. Select Informix Developer Edition Windows 32 Version 11.70 xxxDE and click Continue.
- Provide the information requested and indicate your agreement with the license agreement. Click I confirm to continue.
- Verify that Informix Developer Edition Windows 32 is selected and
that the file version number is 11.70. Click Download
Now.
Note: If Informix is already installed, there is no need to install another copy of the software. Proceed to the "Install the Informix Detective Game database" section of this tutorial.
- Once the download is complete, navigate to the folder containing the downloaded file.
- Unzip the file. Choose the option to unzip and install the file.
- If the unzip does not give the option to install, from the unzipped folder find and click ids_install.exe.
- The install wizard will walk you through the software installation process.
- In order to complete the install successfully, click Accept for each license agreement. Also, select Typical for each setup type, and make note of all the user Informix and passwords you are requested to create.
Install the Informix Detective Game database
- Ensure Informix is installed.
- Download the Informix Detective Game database file from the Downloads section of this tutorial.
- Create a directory called informixgame in drive C.
- Unzip the InformixDetectiveFile.zip file to that directory.
- From the Windows Start menu, choose All Programs > IBM Informix 11.70 > ol_informix1170. A command prompt window will pop up.
- From the command prompt, type
cd\informixgameto get to the informixgame directory. In order to create the database, you need to typedbaccess sysmaster createtables.sql. You should see the messageDatabase created and Database closed. - On the next line, type
SET DBDATE=y4md-to set the date format. - Then type
dbaccess informixgame loadtables.sqlto create the tables in the detective database. The tables are successfully created if you see four messages indicating rows were loaded. The rows loaded messages should reflect 151, 140, 10, and 140 rows loaded. - Close the command prompt window.
Run the Informix Detective Game
In order to run the game's clue file (INFORMIXGAME.JAR), it has to be set up to open with Java Virtual Machine (JVM) software, for example: JAVAW.EXE. To set this up:
- Right-click the INFORMIXGAME.JAR file.
- Click Properties.
- Click the General tab.
- Specify
Type of fileto be Executable Jar File. - The Opens with window should reflect a JVM that you have locally installed on your machine. If this is not the case, click Change.
- From the Open With pop-up window, locate and select your JVM software, for example JAVAW.EXE.
- Click OK.
- Click Apply.
- Click OK again.
You can now launch the INFORMIXGAME.JAR file. To do so, double-click the icon, or you can create a shortcut to the file for easier access.
- From the Windows start menu, choose All Programs > IBM Informix 11.70 > ol_informix1170.
- From the command prompt window, type
dbaccess. A DBAccess window will open. - From the main menu at the top of the interface, select Query-language.
- Select informixgame@ol_informix1170 from the list of databases.
- Select New from the Query-language menu.
- Type an SQL statement.
- Press the Esc key to exit the editor.
- Select Run to run the SQL statement.
Create a shortcut to the Informix Detective Game
To create a shortcut to the INFORMIXGAME.JAR file on your desktop:
- Right-click anywhere on the desktop.
- Select New > Shortcut.
- In the Type the location of the item field, type
C:\informixgame\informixgame.jar. - Click Next.
- In the field called Type a name for this shortcut, type
informixgame(it should already appear by default). - Click Finish.
- To execute SQL statements, use dbaccess:
- From the Windows start menu, choose All Programs > IBM Informix 11.70 > ol_informix1170. A command prompt window will pop up.
- From the command prompt window, type
dbaccess. - From the dbaccess main menu, select Query-language.
- Select informixgame@ol_informix1170 from the list of databases.
- Click New from the Query-language menu.
- Type an SQL statement.
- Press the Esc key to exit the editor.
- Click Run to run the SQL statement.
- To modify your previous SQL statement:
- From the Display menu, click Exit.
- From the SQL menu, click Modify.
- Edit your prior SQL statement.
- Press the Esc key when done editing.
- Click Run.
- If the width of the fields to be displayed is less than 80 characters wide, the results are displayed in a table format.
- If the width of the fields to be displayed is greater than 80 characters wide, the results for each record is displayed over multiple lines, as defined by the fields in the table.
- To see the count of the number of records for an SQL statement, click Next until the number of rows retrieved is displayed.
You are now ready to play the game!



