Open sqllist.php (from beginnersite) and save it as sqlwhereoperators.php. Change the database name (if necessary) and the query so that it extracts and displays all the data from the table you just imported (employees). Remember to change the lines which display the data as well as the query. Look in PHPMyAdmin for the field names and test it.
You have already used WHERE so change the query so that it selects only the employee whose ref equals 10101. Test it.
Now add an exclamation mark before the = to look for people who do not have that ref. Test it.
Now delete the != and replace it with <. Then >. Then <= and >=. Note the results carefully (especially the difference between < and <=).
An empty field in a table is different to one which has never had a value or which has a zero or a space in it. Try replacing the existing query with this to check for a field which has had it's value deleted (you should get 6):
SELECT ref, dob, personal, family, gender, doj FROM employees WHERE gender='';
Try this to see fields which have a null value (none):
SELECT ref, dob, personal, family, gender, doj FROM employees WHERE gender IS NULL;
Finally this looks for fields just containing a single space but, weirdly, it also matches the empty ones:
SELECT ref, dob, personal, family, gender, doj FROM employees WHERE gender=' ';
Each of those should give you a different result.
Sometimes you only want to match partial data. Try this:
SELECT ref, dob, personal, family, gender, doj FROM employees WHERE family LIKE 'Pe%';
That should match any family name beginning with Pe. The % stands for any character or combination for characters (including none). You can use an underscore (_) instead to represent any single character sp Per_y would match Perry and Percy. Try that and some other combinations.