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,
movies table from the
dvd_collection schema that we created earlier
in this tutorial. Right-click on the
table and choose Select Rows - Limit 1000
from the context menu.
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.
movie_id column is set to
AUTO_INCREMENT, so values are not needed
for this column.
Input the following data into the movies table:
|Gone with the Wind||1939-04-17|
|The Hound of the Baskervilles||1939-03-31|
|Above the Law||1988-04-08|
|Iron Man 2||2010-05-07|
Do not modify
movie_id column values.
Click Apply to 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
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
MyFirstConnection tab (or MySQL Workbench)
and then open the
connection from the home page. Execute
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 7.1, “Visual SQL Editor”.