Lecture Note
University
American Baptist CollegeCourse
CSCI 1534 | Data Analysis and VisualizationPages
2
Academic year
2023
Muthia Marhamah
Views
0
Filter Data Data filtering is the process of examining a dataset to exclude, rearrange, or apportion data according to certain criteria. WHERE WHERE command used to set a limitation or condition to your data. Need to use AND / OR to set multiple limitations. For example : SELECT id, city, email, gender FROM customer WHERE city = ‘Jakarta’ AND (email = ‘Gmail’ OR email = ‘Hotmail’) AND gender = ‘Female’ LIMIT The LIMIT clause is used to set an upper limit on the number of tuples returned by SQL. LIMIT command used to result only limited number of row. This could help faster our query especially when we just want to check the overall result. For example : SELECT id, price FROM product ORDER BY price DESC LIMIT 10 IN In is a command that allows you to specify multiple values in a WHERE clause. For example : SELECT id, city, email, gender FROM customer WHERE
city IN (‘Jakarta’, ‘Surabaya) BETWEEN Between is an operator selects values within a given range. For example : SELECT id, city, email, gender FROM customer WHERE Id BETWEEN 10 AND 20 NULL & NOT NULL The IS NULL condition is satisfied if the column contains a null value or if the expression cannot be evaluated because it contains one or more null values. If you use the IS NOT NULL operator, the condition is satisfied when the operand is column value that is not null, or an expression that does not evaluate to null. Code statements : SELECT id, city, email, gender FROM customer WHERE city IS NULL or SELECT id, city, email, gender FROM customer WHERE city IS NOT NULL
Filter Data
Please or to post comments