There are a list of commonly used MySQL queries to create database, as well as work with database such as create table, insert record, update record, delete record, select record, truncate table and drop table and many others.
The following queries are used to perform the
Insert Records Into Table
The command used to insert records to the table. The application of the command to insert records in the table as follow
Syntax:-
INSERT INTO tableName values(value1,value2, ... values);
Example:-
INSERT INTO Persons VALUES (1,'degu','hailu','1049','torino','IT','torin@gmail.com');
Figure 1.1 : – Inserting Records to Table
Selecting Records
Once the records is set or insert records to a table. It is a time to read values from a table. In order to read records from a table the following command is applied
Syntax:-
SELECT *FROM tableName;
Example:-
SELECT *FROM Persons;
Figure 1.2 : – Selecting Records
Updating Records
This is a query that is used to update records that is already saved in the table. The application of using update records
Syntax:-
UPDATE tableName SET
columnName='values',
columnName='values'
WHERE column='values'
Example:-
UPDATE Persons SET LastName='adnew' WHERE PersonID='1';
Figure 1.3 : – Updating Records