1. the MySQL view operation is only supported by the new version of the database. The advantage of the view operation is that it can simplify the query of the database. In particular, we can create a view for some frequently queried data tables first, you can directly query this view when querying this type of data table. This can also improve the query efficiency.
Another benefit of a view is that if you change the field or value of the base data table, the view chart will change accordingly, so we don't have to worry about it, when changing the field value of the base data, the view data is not synchronized.
For example, create a view and query it through the view.
Create view v3 as SELECT B. sid, B. grade, c. cname
FROM grade B, course c
WHERE B. cid = c. cid
Then query a piece of data from the View
Select sid, grade, cname from v3 where sid = 200410001
In this way, do not query a piece of data again using a joint query.
2. Stored Procedures: this operation can make database operations more concise, and the reusability of data operations is also better reflected. stored procedures can implement multi-Table operations, he also allows passing in parameters. For specific operations, refer to the manual.
These two SQL features can be flexibly used in our actual development, and may change some unreasonable database operations in the past, making the program we write more reasonable, easy to maintain.