20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix B<br />

406<br />

Having done that, make sure that you click the Apply Changes button, and then click Close to close the<br />

window. You’re returned to the Query Browser’s default login screen, and the details for connection<br />

Beg<strong>SQL</strong>DB are already entered, as shown in Figure B-28:<br />

Figure B-28<br />

Every time you start up, you can select the login details by simply selecting the connection name from<br />

the Connections drop-down box. It saves filling in the details every time because you only need to enter<br />

the password.<br />

Click OK to continue and open Query Browser.<br />

Because you selected the Beg<strong>SQL</strong>DB connection, any queries or <strong>SQL</strong> is run against the Film Club<br />

database. Also note that unlike My<strong>SQL</strong> Control Center, only one <strong>SQL</strong> statement can be executed at one<br />

time. Chapter 1 contains all the <strong>SQL</strong> for adding tables to the example database, and Chapter 2 covers<br />

how to insert data. So this appendix simply demonstrates how to create one new table, add two rows to<br />

it, and then delete the table from the database. Don’t worry if the <strong>SQL</strong> itself doesn’t make sense; it will<br />

once you’ve read Chapters 1 through 3.<br />

Type the following <strong>SQL</strong> into the <strong>SQL</strong> box at the top of Query Browser, the same box in which you previously<br />

entered CREATE DATABASE FilmClub:<br />

CREATE TABLE MyTable (MyColumn int)<br />

Now click the Execute button to create the table. Now refresh the schemata by right-clicking the<br />

Schemata box and choosing the Refresh Menu option. A small triangle now appears next to the filmclub<br />

database name in the schemata. Click the triangle and you can see that it lists the addition of<br />

MyTable, as shown in Figure B-29:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!