Where condition in SQL
The MySQL WHERE statement is used to define a circumstance when the data is collected from a separate list or joined to several tables. If the specified circumstance is met, then only the unique value of the table is returned. To extract the information and retrieve only the correct records, you can use the WHERE statement.
Note: The WHERE condition is used not only in the Selection assertion but also in the UPDATE assertion, the Remove assertion, etc.!
You may use contrast or logical operators, such as >, <, =, LIKE, NOT, etc. To define a state. The below-given example will explicitly state this notation.
Here, we consider the table of CUSTOMERS with the below-given records.
Now, we will run the below-given query on SQL to fetch the CustomerID, CustomerName and Salary from the above table CUSTOMERS, where the salary is greater than 25000.
After the successful execution of the above SQL query, we got the following output.
Here, we have another instance where we would get the CustomerID, CustomerName and Salary from the database table named CUSTOMERS for a specific customer named Joseph Winget.
After the successful execution of the above SQL query, we got the above-given outcome.
Note- Here, it should be noted that all strings should be specified within single quotes (''). So, as in the instance discussed earlier, should provide numerical data without any quotation.