Author: Awais Khan

  • sum() function

    The MySQL sum() function is used to return the total summed value of an expression. It returns NULL if the result set does not have any rows. It is one of the kinds of aggregate functions in MySQL. Syntax Following are the syntax of sum() function in MySQL: Parameter Explanation aggregate_expression: It specifies the column or expression that…

  • Count() Function

    MySQL count() function is used to returns the count of an expression. It allows us to count all rows or only some rows of the table that matches a specified condition. It is a type of aggregate function whose return type is BIGINT. This function returns 0 if it does not find any matching rows.…

  • Aggregate Functions

    MySQL’s aggregate function is used to perform calculations on multiple values and return the result in a single value like the average of all values, the sum of all values, and maximum & minimum value among certain groups of values. We mostly use the aggregate functions with SELECT statements in the data query languages. Syntax: The following are the…

  • AFTER DELETE Trigger

    The AFTER DELETE Trigger in MySQL is invoked automatically whenever a delete event is fired on the table. In this article, we are going to learn how to create an AFTER DELETE trigger with its syntax and example. Syntax The following is the syntax to create an AFTER DELETE trigger in MySQL: The AFTER DELETE trigger syntax…

  • BEFORE DELETE Trigger

    BEFORE DELETE Trigger in MySQL is invoked automatically whenever a delete operation is fired on the table. In this article, we are going to learn how to create a before delete trigger with its syntax and example. Syntax The following is the syntax to create a BEFORE DELETE trigger in MySQL: The BEFORE DELETE trigger…

  • AFTER UPDATE TRIGGER

    The AFTER UPDATE trigger in MySQL is invoked automatically whenever an UPDATE event is fired on the table associated with the triggers. In this article, we are going to learn how to create an AFTER UPDATE trigger with its syntax and example. Syntax The following is the syntax to create an AFTER UPDATE trigger in MySQL: We…

  • BEFORE UPDATE Trigger

    BEFORE UPDATE Trigger in MySQL is invoked automatically whenever an update operation is fired on the table associated with the trigger. In this article, we are going to learn how to create a before update trigger with its syntax and example. Syntax The following is the syntax to create a BEFORE UPDATE trigger in MySQL:…

  • AFTER INSERT Trigger

    After Insert Trigger in MySQL is invoked automatically whenever an insert event occurs on the table. In this article, we are going to learn how to create an after insert trigger with its syntax and example. Syntax The following is the syntax to create an AFTER INSERT trigger in MySQL: The AFTER INSERT trigger syntax parameter can…

  • BEFORE INSERT TRIGGER

    Before Insert Trigger in MySQL is invoked automatically whenever an insert operation is executed. In this article, we are going to learn how to create a before insert trigger with its syntax and example. Syntax The following is the syntax to create a BEFORE INSERT trigger in MySQL: The BEFORE INSERT trigger syntax parameter can be…

  • DROP Trigger

    We can drop/delete/remove a trigger in MySQL using the DROP TRIGGER statement. You must be very careful while removing a trigger from the table. Because once we have deleted the trigger, it cannot be recovered. If a trigger is not found, the DROP TRIGGER statement throws an error. MySQL allows us to drop/delete/remove a trigger mainly in…