One of the keys to MySQL's success is its graphical interface phpMyAdmin which allows you to
This interface is developed in PHP and can easily be installed on a server. MySQL and phpMyAdmin are generally installed by default on most hosting or development environments.
MySQL queries are written in SQL which is a command line language that may seem austere at first. For a first use of MySQL, we are going to use phpMyAdmin. The latter displays the MySQL queries for each action performed in the graphical interface.
If you do not have a phpMyAdmin installation on your server or your local machine, you can perform the exercises on the interface demo of phpMyAdmin at this address: [https://demo.phpmyadmin.net/master-config/oquer(https://demo.phpmyadmin.net/master-config/) Please note, the databases are cleaned (erased) frequently and the privileges of users are reset. Out of courtesy to others users, do not modify the content of databases that do not belong to you.
In the interface of phpMyAdmin, create a new database:
The interface informs you that your database is empty (no table) and you suggests creating your first table.
In your database, create a
stocks table that contains 4 columns.
On the next page, define the fields of each column:
idcontains a unique identifier which will automatically increment with each new line (check the box
designationcontains a string of 100 characters maximum which will contain the name of the articles.
quatiteis an integer which indicates the quantity in stock.
prixcontains a real which represents the price.
Save and check the table:
The table is created and ready to use.
Browsetab allows you to view the content of the table.
Searchtab allows you to search for a row in the table.
Inserttab allows you to add rows to the table.
Add a few lines into the table and observe the syntax of the SQL queries.
Always leave the
id field empty, it will automatically complete when
creating a new row.