Hi friends how are you? Hope you are doing good, today i am going to share a very important and useful things with you. If you are beginners in mysql, then this tutorial is best for you. Below i have explained some important MYSQL Query Syntax with examples.
1) SELECT – Select data from a table
2) UPDATE – updates data in a table
3) DELETE – delete data from a table
4) INSERT INTO – inserts new data into a table
5) CREATE DATABASE – creates a new table
6) ALTER DATABASE – modifies a table
7) CREATE TABLE – creates a new table
8) ALTER TABLE – modifies a table
9) DROP TABLE – deletes a table
Open the phpmyadmin and create a table using the below code.
CREATE TABLE employees
The INSERT INTO statement is used to insert new records in a table.
"INSERT INTO employees(emp_name,salary)VALUES('Robert','10000')";
Below example select the all data from the employees table
SELECT * FROM employees;
Below example delete the matched data from the employees table
DELETE FROM employees WHERE emp_name="Robert";
Below example Update the existing data from the employees table.
UPDATE table_name SET emp_name="Prem" WHERE emp_name="Robert";
Thank you for giving time on Freewebmentor community. Please don’t forget to subscribe our newsletter or join us on Facebook to be the first to learn the next great thing from freewebmentor.
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari