How to run SQL queries on a database with phpMyAdmin

  Databases
running sql queries on a databse with phpMyAdmin
How to run SQL QUERIES on a database with phpMyAdmin.

Structured Query Language (SQL) is a standardized query language for requesting information from a database. In this tutorial, you’ll learn how to run SQL queries on a database using phpMyAdmin. A query helps you create, read, update and delete (RUN CRUD OPERATIONS) from a table or tables.

Read more about SQL here.

It is very easy to run SQL queries on a database in phpMyAdmin.

In this tutorial, I assume that you have created a database.

  1. First, log into your cPanel.
  2. Click on phpMyAdmin in the DATABASES section. This will open phpMyAdmin in a new tab.
  3. From the tabs at the top, click on SLQ. You can perform simple to complex CRUD operations by typing your queries in the text area provided.
To run SQL Queries, type your query statement then click on Go to execute.
Type your SQL Query statement then click on Go.

Run SQL query to insert Data.

To insert data using a query in phpMyAdmin, you’ll need to write and execute an INSERT QUERY. Normally an INSERT QUERY will have the syntax below:

INSERT INTO DATABASE_NAME.TABLE_NAME (FIELD1, FIELD2) VALUES (‘VALUE 1’, ‘VALUE 2’);

Run SQL query to select Data

A simple SELECT QUERY statment would have the syntax below.

SELECT column1, column2, FROM DATABASE_NAME.TABLE_NAME WHERE column1 = ‘value_x’;

Run SQL query to update data

A basic update query will have the following syntax:

UPDATE DATABASE_NAME.TABLE_NAME SET column1 = ‘value1’, column2 = ‘value2’ WHERE column1 = ‘value_x’;

Run SQL query to delete data

A simple DELETE QUERY will look like this:

DELETE FROM DATABASE_NAME.TABLE_NAME WHERE column1 = ‘value1’;

Once you have written your query, click on GO button to execute.

That is how you can write and execut5e SQL QUERIES on a database in phpMyAdmin.

LEAVE A COMMENT