TransactionA transaction consists of one or more SQL statements, and if all statements execute successfully then the modification will take effect, such as a SQL statement will sell +1, the next +1, and if the second fails, then sales will undo the +
ViewA view is a virtual table (not a real one), which is essentially "getting a dynamic dataset from an SQL statement and naming it", which allows the user to get a result set using only "name" and use it as a table.Select *from (
MYSQL (ii)The previous article is about the basic MySQL operation, this one will be a little difficult to understand, this section of the main content of MySQL view, stored procedures, functions, transactions, triggers, and dynamic execution of
First, the View1. What is a view? The view is a virtual table (non-real), the essence of which is to get a dynamic dataset based on the SQL statement and name it, when the user uses, just use the name to get the result set, and can be used as a
First, the ViewA view is a virtual table (not a real one), which is essentially "getting a dynamic dataset from an SQL statement and naming it", which you can use as a table by simply using "name" to get a result set. Using views we can take out the
Views ViewA view is a virtual table whose contents are defined by a query. As with a real table, a view contains a series of column and row data with names. However, the view does not exist in the database as a stored set of data values. Row and
The previous article is about the basic MySQL operation, this one will be a little difficult to understand, this section of the main content of MySQL view, stored procedures, functions, transactions, triggers, and dynamic execution of SQLViews ViewA
The previous article is about the basic MySQL operation, this one will be a little difficult to understand, this section of the main content of MySQL view, stored procedures, functions, transactions, triggers, and dynamic execution of SQLViews ViewA
/** Creating a database **/Create Database testdata;/**return to query OK; Indicates that the creation was successful.**//** Deleting a database **/Drop database testdata;/**return to query OK; Indicates a successful creation**//** shows the engines
The previous article is about the basic MySQL operation, this one will be a little difficult to understand, this section of the main content of MySQL view, stored procedures, functions, transactions, triggers, and dynamic execution of SQLViews ViewA
Use of SQL triggers
Triggers: A special type of stored procedure that is not invoked directly by the user or manually, but is triggered by events, such as when working on a table (insert,delete,update). When a trigger is created, it is defined so
MySQL Advanced table: Join up and down table: Union #自动去重 (when two tables of data, there are duplicates will automatically go to the weight) UNION ALL #不去重例如: Select Sid,sname from Snameunionselect ti D,tname from Teacherselect sid,sname to
First, the ViewA view is a virtual table (not a real one), which is essentially "getting a dynamic dataset from an SQL statement and naming it", which you can use as a table by simply using "name" to get a result set. Using views we can take out the
Directory (?) [+]
Transaction
Commit or roll back
Common transaction Directives
Characteristics of the business acid
Trigger
Create a Trigger
Manage triggers
TransactionsCreateTable Swpu
Creating triggers
Create a trigger with only one execution statementCREATE TRIGGER Trigger Name before| After Trigger eventOn table name for each ROW executes the statement where the trigger name parameter refers to the name of the trigger to be
Views ViewA view is a virtual table whose contents are defined by a query. As with a real table, a view contains a series of column and row data with names. However, the view does not exist in the database as a stored set of data values. Row and
a triggerUse triggers to customize the behavior of the user in the "Add, delete, change" operation of the table, note: No queryCreate a trigger# Insert before create TRIGGER tri_before_insert_tb1 before insert on TB1 for each rowbegin ... end#
Mysql> #接下来学习触发器的概念Mysql> #触发器是由事件来触发某个操作的, including insert update DELETE statementMysql> #触发器的基本形式:Mysql> #create trigger Trigger name Before|after trigger event on table name for each row execution statementMysql> #如果需要执行多条语句则使用 begin ... end
--Trigger: A trigger is a special kind of stored procedure, only for "adding and deleting"--The special place of the trigger is that the trigger is triggered by the operation of the database table.--stored procedures are performed by man -made
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.