workbench-en.a4
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
MySQL Workb<strong>en</strong>ch Tutorials<br />
MySQL Workb<strong>en</strong>ch automatically discovers that address.city_id has be<strong>en</strong> defined as a foreign key refer<strong>en</strong>cing the<br />
city.city_id field. Drop the country table onto the canvas and immediately you should see the relationship betwe<strong>en</strong> the<br />
country table and the city table. ( See Figure 5.1, “The sakila EER diagram” to view a PNG file of all the relationships in<br />
the sakila database.)<br />
Choose the Properties tab of the panel on the lower right and th<strong>en</strong> click one of the tables on the canvas. This displays the properties<br />
of the table in the Properties window. While a table is selected you can use the Properties window to change a table's<br />
properties. For example, <strong>en</strong>tering #FF0000 for the color value will change the color acc<strong>en</strong>t to red.<br />
Changing the color of a table is a good way to id<strong>en</strong>tify a table quickly — something that becomes more important as the number of<br />
tables increases. Changing the color of a table is also an easy way to id<strong>en</strong>tify a table in the Model Navigator panel. This panel,<br />
the uppermost panel on the left side of the scre<strong>en</strong>, gives a bird's eye view of the <strong>en</strong>tire EER canvas.<br />
Save your changes to a MySQL Workb<strong>en</strong>ch Models file (mwb) by choosing SAVE from the FILE m<strong>en</strong>u or by using the keyboard<br />
command Ctrl S.<br />
4.2. Using the Default Schema<br />
Wh<strong>en</strong> you first op<strong>en</strong> MySQL Workb<strong>en</strong>ch a default schema, mydb appears as the left-most tab of the PHYSICAL SCHEMATA section<br />
of MySQL Workb<strong>en</strong>ch. You can begin designing a database by using this default schema.<br />
Figure 4.2. The default schema<br />
To change the name of the default schema, double click the schema tab. This op<strong>en</strong>s a schema editor window docked at the bottom<br />
of the application. To undock or redock this window, simply double click anywhere in the editor title bar.<br />
6