You are on page 1of 5

MySQL Introduction- Php MyAdmin

1. How to open PhpMyAdmin

STEP 1-Open any web browser and visit https://www.apachefriends.org/index.html. On the home page,
we can see the optionto download XAMPP for three platforms- Windows, MAC, and Linux. Click on
XAMPP for Windows.

click on
it, a

message displaying the automatic start of download appears on the screen.

STEP 2-After the download is completed, double click the .exe extension file to start the process of
installation. ‘

STEP 3- After clicking the .exe extension file, the XAMPP setup wizard opens spontaneously. Click on
"NEXT" to start the configuration of the settings.

STEP 4-After that, a 'Select Components' panel appears, which gives you the liberty to choose amongst
the separate components of the XAMPP software stack for the installation. To get a complete localhost
server, it is recommended to install using the default options of containing all available components.
Click "NEXT" to proceed further.
STEP 5-After the successful installation of the XAMPP setup on your desktop, press the "FINISH"
button.
On clicking the FINISH button, the software automatically launches, and the CONTROL PANEL is
visible. The image below shows the appearance of the final result.

Click
the
Start

button on the Apache and MySQL.


Now open the browser and type http://localhost/phpmyadmin/. phpMyAdmin will start running in the
browser.

2. How to
create a
Database
Click on
New to
create a database and enter the database name in Create database field and then click on Create button.
We can create any number of databases.

3.

How to create a table (with Primery Key)

Enter the table name, number of columns, and click on Go. A message will show that the table is
created successfully.

Now
enter the
field
name,
type,
their
size, and
any

constraint here and save it.


For adding primary key.

Adding a Primary Key to a New Table In phpMyAdmin


When creating a new table in phpMyAdmin, select PRIMARY from the Index dropdown on the column
that will be the primary key. Check the box in the A_I column if this will be an auto incrementing key.
4. How to insert using Sql

There are two ways to insert values in a table.


I) INSERT INTO table_name VALUES (value1,value2,value3....);
In this method there is no need to specify the column name where the data will be inserted, you need
only their values.
II) INSERT INTO table_name (column1,column2,column3.…) VALUES (value1, value2, value3.....);
The second method specifies both the column name and values which you want to insert.

5. How to update using Sql


SQL UPDATE statement is used to change the data of the records held by tables. Which rows is to be
update, it is decided by a condition. To specify condition, we use WHERE clause.
UPDATE table_name SET [column_name1= value1,… column_nameN= valueN] [WHERE
condition]
eg : UPDATE students SET userName='Arun' WHERE studentId = '3' .

6. How to delete using sql


The SQL DELETE statement is used to delete rows from a table. Generally DELETE statement
removes one or more records from a table.
SQL DELETE Syntax
DELETE FROM table_name WHERE condition];

eg: DELETE FROM employee WHEREid=101;

7. How To select using Sql


The SELECT statement is the most commonly used command in Structured Query Language. It is used
to access the records from one or more database tables and views. It also retrieves the selected data that
follow the conditions we want
Syntax of SELECT Statement in SQL
SELECT Column_Name_1,Column_Name_2,.....,Column_Name_N FROM Table_Name;

eg: SELECT * FROM employee_details WHERE emp_age=30;

You might also like