The following walkthrough describes how to add a database connection, create a database and a table. To complete the walkthrough you must have a MySQL server running.
To get acquainted with Fusion for MySQL, let us perform some common operations and see how a database and data within it can be managed. In order to interact with MySQL, a client must first establish a connection with the server.
Note
In this topic as well as in the other topics, clicking with the right mouse button is referred to as right-click. Clicking with the left mouse button is referred to as click.
Double-click means that you should click quickly with the left mouse button twice.
In order to complete this walkthrough, you will need access to MySQL 5.0 server version 5.0.30 or higher, or to MySQL server 5.1.13 or higher.
To create database and tables you should have the CREATE privilege on the created database or the global CREATE privilege.
Now, suppose you don not have any databases on this server. You have to create one to continue working and proceed in step-by-step learning of Fusion for MySQL.
Creating a database in MySQL is not very difficult as it has only one property: its name. Now to go on, you have to create several tables inside this database.
Suppose you need to manage an organization’s employees. To keep track of their status, you might want to create two tables, one named Emp with data on every employee and the other named Dept with data on departments that employees work in.
Let table Emp have the following structure:
Column name | Type | Description |
---|---|---|
EmpNo | INT | Internal employee’s number |
EName | VARCHAR (10) | Name of the employee |
Job | VARCHAR (9) | Occupation |
MGR | INT | Internal number of employee’s manager |
HireDate | DATETIME | Date when the employee was hired |
Sal | FLOAT | Salary of the employee |
Comm | FLOAT | Commission |
DeptNo | INT | Internal number of a department where the employee works |
Primary index should be created for column EmpNo.
Table Dept may be described as follows:
Column Name | Type | Description |
---|---|---|
DeptNo | INT | Internal number of the department |
DName | VARCHAR (14) | Name of the department |
Loc | VARCHAR (14) | Location of the department |
Primary index should be created for column DeptNo.
In the dialog box that opens, type the name of the table (it should be Emp) and click Create.
Table editor appears with a blank document in it.
Note
Length of fields with variable size can be changed in the field Length in the middle-right of the column editor.
There are two lists in the dialog box: Index columns and Available columns. In the Available columns list, select field EmpNo and click the Add Field button.
Field EmpNo is removed from the original list and added to the Index columns list.
Now, the first table is ready. Repeat these steps for table Dept to create it.