Let’s see how to write case statement on mysql using a example. let’s you have a table emp on your database like this Now write the below query code on sql window SELECT *, (CASE WHEN salary=3000 THEN ‘three thousand’ WHEN salary = 10000 THEN ‘Ten Thousand’ ELSE ‘zero’ END) AS result_salary FROM `emp`; get
Tag: mysql
What is Transaction and how to implement transaction in php using mysqli ?
A transaction is a sequential group of database manipulation operations, which is performed in a sequential manner. In other words, a transaction will never be complete unless each individual operation within the group is successful. If any step or process within the transaction fails, the entire transaction will fail. Properties of Transactions Atomicity − All operations
What is Database index and why it is used ?
A database index is a structure that improves the speed of searches/queries operations in a table.Basically, it is used for querying optimization. Indexes can be created using one or more columns, providing the basis for the efficient ordering of access to records. Note: Update and Insert operation a table with indexes takes more time than