What is trigger in mysql with example?



What is trigger in mysql with example?..

Answer / Vivekanand Ojha

In MySQL, a trigger is a stored procedure that is automatically executed when an event occurs on a specific table. For example, you could create a trigger to insert data into a log table every time a row is inserted into another table.nCREATE TRIGGER ins_log AFTER INSERT ON mytable FOR EACH ROW INSERT INTO mylog VALUES (NEW.id, NEW.column1, NEW.column2);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MySQL Interview Questions

How to see the create table statement of an existing table?

1 Answers  


Where is mysql data stored?

1 Answers  


How do I start mysql in linux?

1 Answers  


What is username in mysql?

1 Answers  


How can I insert images into a Mysql database?

1 Answers  


How can you import tables from a sql file into a database by using the mysql client?

1 Answers  


How can you change the password of a mysql user?

1 Answers  


How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others?

4 Answers  


Is mysql port 3306 tcp or udp?

1 Answers  


What is mysql in linux?

1 Answers  


What is diff b/w MYISAM and INNODB storage engine. and also define the benifits and drawbacks of both storage engine

1 Answers  


Can varchar be primary key?

1 Answers  


Categories