A case of adding, deleting, modifying and querying statements realized by sql
This article mainly introduces the case of adding, deleting, modifying and querying sentences in sql, which has a certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
The add, delete, change and query statements in sql are used to operate on the data in the database, so this article will take a look at the specific writing of SQL add, delete, query and change statements.
I. the increase of SQL sentences
Name of the insert into table (field name) values (value)
Insert a student's data into the student table
Insert into student (num,name,sex,age) values (140010, Zhang San, male, 23)
II. Deletion of SQL sentences
Delete this piece of data for num=140011 in the student table.
Delete from student where num=140011
III. Modification of SQL sentences
We can change the age value with a num of 140010 to 21.
Update student set age = 21 where ID=140010
IV. Search of SQL sentences
The query statement is very important, so you need to talk about it in detail.
1. Query all data in student table
Select * from student
2. Query all name and sex in student table
Select name,sex from student
3. Query the data of the row whose num is 140010
Select * from where id = 140010; thank you for reading this article carefully. I hope it will be helpful for everyone to share the case of adding, deleting, modifying and searching sentences in sql. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!