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 dbForge Studio, 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.
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 do not have any databases on this server. You have to create one to continue working and proceed in step-by-step learning of dbForge Studio.
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 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:
|EmpNo||INT||Internal employee’s number|
|EName||VARCHAR (10)||Name of the employee|
|MGR||INT||Internal number of employee’s manager|
|HireDate||DATETIME||Date when the employee was hired|
|Sal||FLOAT||Salary of the employee|
|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:
|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”.
Table editor appears with a blank document in it.
Length of fields with variable size can be changed in the field “Length” in the middle-right of the column editor.
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.