Category: Conditions

  • MySQL BETWEEN Condition

    The MYSQL BETWEEN condition specifies how to retrieve values from an expression within a specific range. It is used with SELECT, INSERT, UPDATE and DELETE statement. Syntax: Parameters expression: It specifies a column. value1 and value2: These values define an inclusive range that expression is compared to. Let’s take some examples: (i) MySQL BETWEEN condition with numeric…

  • MySQL IS NOT NULL Condition

    MySQL IS NOT NULL condition is used to check the NOT NULL value in the expression. It is used with SELECT, INSERT, UPDATE and DELETE statements. Syntax: Parameter expression: It specifies a value to test if it is not NULL value. MySQL IS NOT NULL Example Consider a table “officers” having the following data. Execute the…

  • MySQL IS NULL Condition

    MySQL IS NULL condition is used to check if there is a NULL value in the expression. It is used with SELECT, INSERT, UPDATE and DELETE statement. Syntax: Parameter expression: It specifies a value to test if it is NULL value. Consider a table “officers” having the following data. Execute the following query: Output: Note: Here, you…

  • MySQL Not Equal

    MySQL Not Equal is an inequality operator that used for returning a set of rows after comparing two expressions that are not equal. The MySQL contains two types of Not Equal operator, which are (< >) and (! =). Difference Between (< >) and (! =) Operator The Not Equal operators in MySQL works the same to…

  • MySQL NOT Condition

    The MySQL NOT condition is opposite of MySQL IN condition. It is used to negate a condition in a SELECT, INSERT, UPDATE or DELETE statement. Syntax: Parameter condition: It specifies the conditions that you want to negate. MySQL NOT Operator with IN condition Consider a table “officers”, having the following data. Execute the following query: Output:…

  • MySQL Exists

    The EXISTS operator in MySQL is a type of Boolean operator which returns the true or false result. It is used in combination with a subquery and checks the existence of data in a subquery. It means if a subquery returns any record, this operator returns true. Otherwise, it will return false. The true value is always…

  • MySQL ANY

    The ANY keyword is a MySQL operator that returns the Boolean value TRUE if the comparison is TRUE for ANY of the subquery condition. In other words, this keyword returns true if any of the subquery condition is fulfilled when the SQL query is executed. The ANY keyword must follow the comparison operator. It is noted that ALL SQL operator…

  • MySQL IN Condition

    The MySQL IN condition is used to reduce the use of multiple OR conditions in a SELECT, INSERT, UPDATE and DELETE statement. Syntax: Parameters expression: It specifies a value to test. value1, value2, … or value_n: These are the values to test against expression. If any of these values matches expression, then the IN condition will evaluate…

  • LIKE condition

    In MySQL, LIKE condition is used to perform pattern matching to find the correct result. It is used in SELECT, INSERT, UPDATE and DELETE statement with the combination of WHERE clause. Syntax: Parameters expression: It specifies a column or field. pattern: It is a character expression that contains pattern matching. escape_character: It is optional. It allows you to…

  • Boolean

    A Boolean is the simplest data type that always returns two possible values, either true or false. It can always use to get a confirmation in the form of YES or No value. MySQL does not contain built-in Boolean or Bool data type. They provide a TINYINT data type instead of Boolean or Bool data types. MySQL considered value…