How to use the MySQL Installer and MySQL Workbench

In a previous tutorial, we saw how a database and table can be created in mySQL. Here is how you can run this on a local machine with the mySQL Installer and mySQL Workbench.

1. Firstly, make sure you have installed mySQL using the mySQL Installer available from dev.mysql.com. For instance, here is the Installer suite for the Windows operating system:

installer suite

2. Once that has been installed, you will then configure your server parameters. Select your configuration type as “Development Machine”, with port number 3306 and host as localhost. As you go through the menus, you will also be asked to assign a password for your server.

MySQL installer

3. Open up the MySQL 5.7 command line client and enter your password.

MySQL Installer

4. You then run your SQL queries within the command line. Firstly, the database is created:

Create Database

5. Then, we create and configure our table using our previous queries:

Create Table

6. To display the table, open up MySQL Workbench and click on the “Local instance MySQL Router”:

MySQL Workbench

7. Once you have entered your password, you can then enter SELECT * FROM stock_selections to display all the data in the table:

MySQL Workbench

Full Script

CREATE DATABASE MGFinance;
use MGFinance;

CREATE TABLE stock_selections
(
ID varchar(255),
YearlyReturn decimal(18,5),
DividendYield decimal(18,5),
DebtEquity decimal(18,5),
PERatio decimal(18,5),
PricetoFCFRatio decimal(18,5),
YearlyEPSChange decimal(18,5),
NetIncome decimal(18,5),
ShareholderEquity decimal(18,5),
Sales decimal(18,5),
Inventory decimal(18,5)
);

INSERT INTO stock_selections (ID, YearlyReturn, DividendYield, DebtEquity, PERatio, PricetoFCFRatio, YearlyEPSChange, NetIncome, ShareholderEquity, Sales, Inventory) VALUES ('3SOWO', '8.11', '0.7', '0.46', '14.8', '7.39', '-9.58', '718805730', '3146789135', '398935732', '152591876'), ('AFASM', '14.2', '0.71', '1.29', '5.94', '7.4', '29.29', '493395901', '3171592425', '871819920', '495389897'), ('ASLWQ', '16.12', '1.23', '0.11', '17.94', '12.37', '-17.11', '785854992', '3366086537', '804417721', '498203160'), ('BBDAA', '-14.08', '4.85', '1.61', '16.54', '12.64', '1.61', '273214402', '1810273098', '242358112', '145935702'), ('BXXOW', '17.11', '0.11', '1.31', '7.57', '11.98', '14.31', '266647538', '2941392555', '377324475', '176547145'), ('CBLEE', '-15.3', '4.16', '1.48', '8.43', '14.68', '6.48', '136913987', '4520039721', '306417258', '155456791'), ('IOSPA', '19.26', '2.87', '0.59', '22.63', '15.98', '26.59', '759573606', '2119671374', '618321357', '478249155'), ('KWOSP', '-15.64', '5.45', '0.96', '21.3', '13.81', '50.26', '440168276', '1787569036', '158191662', '386845657'), ('MMRMM', '13.78', '0.39', '1.17', '16.32', '6.5', '17.17', '505687204', '1843253620', '495740645', '456053827'), ('NNFFN', '14.36', '4.9', '0.96', '18.37', '9.74', '-5.96', '465839986', '4945897852', '634646570', '491299402'), ('OOSLA', '8.17', '0.3', '1.83', '8.74', '9.3', '3.83', '664444354', '3548211543', '525069484', '102283045'), ('SADLA', '13.11', '3.44', '0.78', '18.65', '6.42', '30.78', '433585899', '2026413087', '603175377', '244785459'), ('SLDWE', '-3.54', '2.75', '0.88', '8.48', '13.89', '-7.88', '244254641', '3128993268', '642955083', '390710702'), ('SPQPO', '-6.55', '2.13', '0.14', '25.66', '15.31', '-9.14', '677650559', '2328483810', '456055649', '321279232'), ('STOWG', '-14.06', '2.85', '0.61', '10.94', '8.62', '11.61', '475063755', '3283736400', '795785580', '385985579'), ('WOEPQ', '0.03', '3.13', '1.84', '22.84', '9.23', '21.84', '410089090', '3591560399', '160777388', '218052057'), ('WOQPP', '-2.07', '2.64', '0.59', '19.1', '8.47', '10.59', '626769580', '4357602324', '680939681', '210111931'), ('WOWOL', '18.87', '0.18', '0.21', '24.29', '12.86', '-20.21', '167320788', '2665596994', '707040194', '337396151'), ('WWIOP', '-2.25', '3.31', '0.69', '13.13', '13.7', '-2.69', '382902244', '1469725591', '624286274', '226692854'), ('ZZXAAZ', '0.77', '3.5', '2.9', '12.94', '7.26', '-6.9', '398499039', '3379796323', '432637933', '309340545');

SELECT ID FROM stock_selections;