MySQL databasesSpanish version

Support article

What is an SQL query and how is it used?

Learn what an SQL query is, what it is used for in a database and how it appears in WordPress, phpMyAdmin and web hosting.

Published: 24/06/2026Updated: 24/06/2026

Introduction

A query is an instruction sent to a database to request, modify, add or remove information.

Even if the term sounds technical, queries are part of many everyday actions on a website. When someone logs into WordPress, publishes a post, searches for a product or sends a contact form, a database is often working in the background.

What query or SQL query means

A query is a question or command sent to a database.

To make the database understand that instruction, a language called SQL is normally used.

SQL means Structured Query Language. It is used in well-known databases such as:

  • MySQL.
  • MariaDB.
  • PostgreSQL.
  • SQL Server.
  • Oracle Database.

In web hosting, especially with WordPress and other CMS platforms, MySQL and MariaDB are the most common options.

How a database query works

When a website needs information, it sends a query to the database. The database processes it and returns the result.

A simple example would be:

SELECT * FROM usuarios;

This query asks the database to show all records from the table called usuarios.

Main types of SQL queries

1. SELECT queries to retrieve information

They are used to read data stored in the database.

2. INSERT queries to add data

They are used when you want to create a new record.

3. UPDATE queries to modify data

They are used to change information that already exists.

4. DELETE queries to remove data

They are used to delete records from the database.

Do I need to learn SQL to create a website?

Not always. Many tools such as WordPress, Joomla or PrestaShop handle the database for you.

Even so, understanding basic SQL can be useful if you need to troubleshoot, review information in phpMyAdmin or work with a custom development.

How to run SQL queries from phpMyAdmin

  1. Open phpMyAdmin from your hosting panel.
  2. Select the database you want to work with.
  3. Open the SQL tab.
  4. Write or paste the query.
  5. Review it carefully before running it.

Useful tips before running SQL queries

  • Make a backup first.
  • Double-check the database and table name.
  • Be especially careful with UPDATE and DELETE queries.

Frequently asked questions about SQL queries

Can an SQL query damage my website?

Yes, if it modifies or deletes important data by mistake.

Does WordPress use SQL queries?

Yes. WordPress constantly uses database queries to work.

Are MySQL and SQL the same thing?

No. SQL is the language. MySQL is one database system that uses SQL.

Can I use SQL without being a programmer?

Yes, for simple checks or small tasks, but it is best to proceed carefully.

Where can I see my website database?

Normally from phpMyAdmin inside your hosting panel.

Conclusion

An SQL query is simply the way a website or an administrator asks a database to do something. You do not need to master SQL to use hosting, but understanding the basics can help you manage your website with more confidence.