We can use the WHERE statement to be selective.
I'm sure you can understand that. Select the name column from the table people where the gender column is equal to male. What would this select?
Bob, Joe, Jeff
We could select every column from the table where the gender is female.
That would select all the information from the table where the gender contains "female". Simple enough? SQL speaks for itself, it does what it says, it isn't difficult at all.
We can insert new rows into the database if we wish, here's the structure.
That statement would insert a new row. In the first brackets we list the columns in which we want to enter a value (all in this case), in the second set of brackets we enter the value. The order of the values listed in the first bracket must match the order of the values to insert in the second brackets. So now we have a new row.
Maybe we want to delete a row from the table, or delete multiple rows, here's how we do it.
This statement would delete any row where the name is Joe, read the query, it does what it says. So now we would have:
We could delete all the males from the table.
Now we would have:
It really does speak for itself, you just need to learn the statements.
No Comments for this page.