Why Learn It?
 

Manipulating Data

Previous previous|next Next Page

Now that you have created tables in the database, you learn how to insert data into the tables, update existing data, and delete data that is no longer required. You also learn how to save the changes you are making.

INSERT, UPDATE, and DELETE are the data-manipulation (DML) statements:

  • Use the INSERT statement to add a new row to an existing table.
  • Use the UPDATE statement to modify existing rows in a table.
  • Use the DELETE statement to remove rows from a table.

When using these statements, you can also control your transactions by choosing to save your data by using COMMIT operations or discard changes by using a ROLLBACK operation.

You will help Sheila manage data in the database. Sheila needs to add rows for new employees and also update employee records for employees who have been promoted or transferred to other departments. Sheila also needs to remove the records of employees who are no longer in the company. After she makes her changes, Sheila needs to make her changes permanent by saving them.