can anyone explain about stored procedure,Triggers and
transaction in php?

Answers were Sorted based on User's Feedback



can anyone explain about stored procedure,Triggers and transaction in php?..

Answer / prasadkonnur

A stored procedure is a set of SQL commands that can be
compiled and stored in the server. Once this has been done,
clients don’t need to keep re-issuing the entire query but
can refer to the stored procedure.This provides better
overall performance because the query has to be parsed only
once, and less information needs to be sent between the
server and the client. However, stored procedures of
course do increase the load on the database server system,
as more of the work is done on the server side and less on
the client (application) side.

A trigger is effectively a type of stored procedure, one
that is invoked when a particular event occurs.For example,
you can install a stored procedure that is triggered each
time a record is deleted from a transaction table and that
stored procedure automatically deletes the corresponding
customer from a customer table when all his transactions are
eleted.

Indexes are used to find rows with specific column values
quickly.Without an index, MySQL must begin with the first
row and then read through the entire table to find the
relevant rows. The larger the table, the more this costs. If
the table has an index for the columns in question, MySQL
can quickly determine the position to seek to in the
middle of the data file without having to look at all the
data. If a table has 1,000 rows, this is at least 100 times
faster than reading sequentially. If you need to access most
of the rows, it is faster to read sequentially, because this
minimizes disk seeks.

Is This Answer Correct ?    8 Yes 2 No

can anyone explain about stored procedure,Triggers and transaction in php?..

Answer / jit

A stored procedure is simply a procedure that is stored on
the database server. MySQL developers have to date
unthinkingly written and stored their procedures on the
application (or web) server, mainly because there hasn't
been an option. That has been limiting. Some have claimed
that there are two schools of thought - one claiming that
logic should be in the application, the other saying it
should reside in the database. However, most professionals
would not bind themselves to one or other viewpoint at all
times. As always, there are times when doing either makes
sense. Unfortunately, some of the staunchest adherents of
the in the application school are only there because until
now they have had no choice, and it is what they are used to
doing.

Triggers are programmable events that react to queries and
reside directly on the database server. Triggers can be
executed before or after INSERT, UPDATE or DELETE
statements.There are several reasons to use triggers.
Triggers can automate a lot of stuff that you may have been
doing by hand before. The main reason I use triggers is to
maintain the integrity of one table that might rely on
another table. For example, if TableA references TableB and
a value from TableB gets deleted, you could have a trigger
setup to handle the data in TableA. Perhaps the data in
TableA should be reset to a generic value or maybe the data
should just be deleted completely.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More PHP Interview Questions

When sessions ends?

0 Answers  


What is the alternative structure for control structures?

0 Answers  


What is a static variable in php?

0 Answers  


i want simple programs in php and outputs and how to use in web developed side in php briefly explined in exmple

2 Answers  


How to access a specific character in a string?

0 Answers  






Do you know what is the use of rand() in php?

0 Answers  


What is in php 7?

0 Answers  


What does php mean?

0 Answers  


How can you "tell" MySQL server to cache a query?

2 Answers  


What is input sanitization in php?

0 Answers  


What is php static function?

0 Answers  


Explain what is memcache?

0 Answers  


Categories