---------------------------------------------------------------------------
Q what is the major similarities and difference b/w prepaired statement and StoredProcedures
I said Store procedures include function,cursor, while prepaired statement doesnot !!
please correct me
---------------------------------------------------------------------------
The similarity is that both preparedStatement & Stroed Procedure are precompiled on the database. Hence database need not create a query plan ateach execution time
The difference is that you you can write DB programming logic in Stored Procedure, pass IN,OUT , IN-OUT paramaters, use variables, conditional logic etc,
With PreparedStatments you can only execute parameterised SQL queries.
---------------------------------------------------------------------------
Q will the query will run faster on Delete/insert/Update query if table has Index on it ?
---------------------------------------------------------------------------
The query will run slower if indexes are used. This is because the databse alos need to update the index table aliong with your actual table for insert, delete, update operations.
But for select queries using coulmns with indexes for search, it will definitely improve performance!!!