Basic MySQL Queries You Should Know!

Talat Waheed
3 min readSep 28, 2024

--

MySQL is a relational database management system based on SQL
SQL(Structured Query Language) is used to make a request to retrieve data from a Database.

Created by Author

There are some basic queries you should know.

Show Databases

It displays information on all the existing databases on the server.

Screenshot by Author

Create Database

Using the create database statement we can create a new SQL database.

Screenshot by Author

SELECT Database

USE statement is used to select any existing database in the SQL schema.

Screenshot by Author

DELETE Database

It is used to drop an existing database in SQL schema.

Screenshot by Author

DELETE

It will delete data from a database. You can delete data from a table using DELETE

Screenshot by Author

SELECT

It will fetch data from a database. It will show selected data in an existing database.

Screenshot by Author

UPDATE

It is used to modify existing data in the table.

Screenshot by Author

ALTER TABLE

It is used to modify existing data. In the screenshot below, I have added a new column to an existing table.

Screenshot by Author

INSERT INTO

Inserts new data into a database. You can insert single or multiple data in a single query

Screenshot by Author

So, these are some basic MySQL Queries you should know.
There are many more queries in MySQL which are also important for performing backend queries like — CREATE, RENAME, TRUNCATE, etc.

Thanks for giving me your precious time, If you like my content and want to show support, give a few claps and follow for more such content.

--

--