| Free tutorials for Java, Eclipse and Web programming |
The following demonstrates how to insert, updates and deletes entries from a database.
Table 2. Select
| Command | Description |
|---|---|
| SELECT * FROM TABLE table_name; | Selects all the data from table "table_name" |
Table 4. Update
| Command | Description |
|---|---|
| update table_name SET field = value WHERE condition; | Updates field with value in table_name given then the where condition is met. |
Table 5. Delete
| Command | Description |
|---|---|
| DELETE FROM table_name WHERE id='8'; | Deletes an entry from table "table_name"which has the id 8. Requires that the table has a column "id". |
| delete from table_name where id <> 1 and id <> 29;; | Deletes all entries from table "table_name" except the entries with id "1" and "29". |