1: An SQL statement can be added to the two tables at the same time, update, delete operations?
2: Can a SQL statement have only SELECT statements for multiple table operations at the same time?
3: What if multiple Add/update/delete action statements are separated by semicolons?
4: What happens if multiple SELECT statements are separated using semicolons?
Reply content:
1: An SQL statement can be added to the two tables at the same time, update, delete operations?
2: Can a SQL statement have only SELECT statements for multiple table operations at the same time?
3: What if multiple Add/update/delete action statements are separated by semicolons?
4: What happens if multiple SELECT statements are separated using semicolons?
1: An SQL statement can be added to the two tables at the same time, update, delete operations?
No, of course, if you ;
pass a two-piece SQL passed in the past can be executed. But that's strictly not the point.
2: Can a SQL statement have only SELECT statements for multiple table operations at the same time?
Yes, look what you're referring to. Multiple table operations, if more than one structure of the table. Use Union
to combine multiple table results. There are also sub-queries, also considered as select multiple tables.
3: What if multiple Add/update/delete action statements are separated by semicolons?
Of course you can pull. Equivalent to executing more than one statement: Some engines and frameworks, however, are forced to filter this type to prevent them from being injected. Otherwise, someone inserts a semicolon in the middle of the query statement, so you can execute any statement that he wants to execute.
4: What happens if multiple SELECT statements are separated using semicolons?
This also looks at the engine, most of which will return the result of your request in turn. There are also frameworks that return the first one, and some return the last. According to the framework suggest you write a simple SQL to do the next test will know.
PS. It is generally not allowed to have multiple SQL at once. Otherwise it's really dangerous ...
Answer only question 1.
Does the view count?
MySQL supports a thing called "view" that can make multiple tables into a single view. Adding or deleting this view can affect multiple tables.
Description of the view in MySQL 5.7: http://dev.mysql.com/doc/refman/5.7/en/views.html