In the previous section, you created a model, schema, and table. You also forward engineered your model to the live MySQL server. This section uses MySQL Workbench to add data into your MySQL database.
Open a MySQL connection.
From the Navigator panel on the left, select the
moviestable from the
dvd_collectionschema that we created earlier in this tutorial. Right-click on the
moviestable and choose from the context menu.Note
The Navigator panel has both Management and Schemas tabs.
This displays the query and its associated results grid. The table is empty, and data may be added into the results grid.Note
movie_idcolumn is set to
AUTO_INCREMENT, so values are not needed for this column.
Input the following data into the movies table:
title release_date Gone with the Wind 1939-04-17 The Hound of the Baskervilles 1939-03-31 The Matrix 1999-06-11 Above the Law 1988-04-08 Iron Man 2 2010-05-07Note
Do not modify
Clickto apply these changes to the live MySQL server.
View the data grid again and observe the generated
Optionally, you might confirm the changes by checking an external source, such as the MySQL Command Line Client. To check, enter
SELECT * FROM movies;from the MySQL Command Line Client to confirm that the data was entered.
You can also use MySQL Workbench to perform a similar check. Close the
MyFirstConnectiontab (or MySQL Workbench) and then open the
MyFirstConnectionconnection from the home page. Execute
USE dvd_collection; SELECT * FROM movies;to display the newly entered data.
In this section of the tutorial, you have learned how to add data to your database, and also how to execute SQL statements using MySQL Workbench.
For additional information about the SQL editor, see Section 8.1, “Visual SQL Editor”.