MYSQL is required to filter data in Chapter 6 of Reading Notes. mysql is required.
Mysql Introduction
MySQL is an open-source Relational Database Management System (RDBMS). the MySQL database system uses the most common database management language-Structured Query Language (SQL) for database management.
When using both the order by and where clauses, the order by clause should be placed after the WHERE clause; otherwise, an error will occur.
1. mismatch check
Copy codeThe Code is as follows:
SELECT vend_id FROM products where vend_id <> 1003
Equivalent
Copy codeThe Code is as follows:
SELECT vend_id FROM products where vend_id! = 1003
2. Range check
To check the value of a range, you can use the BETWEEN operator. Its syntax is slightly different from the operators of other WHERE clauses, because it requires two values. Used to retrieve the price and date.
Copy codeThe Code is as follows:
SELECT prod_name, prod_price FROM products WHERE prod_price BETWEEN 5 AND 10;
3. Check for null values
NULL has no value. It is different from a field that contains 0, an empty string, or only a space.
Copy codeThe Code is as follows:
Select * from products
Where prod_price is Null;
The above is a small series to share with you the MYSQL will know the Reading Notes, chapter 6 of the filtering data content, I hope to help you!