20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix B<br />

426<br />

Figure B-56<br />

You need to use the <strong>SQL</strong> view in order to try out the <strong>SQL</strong> code in this book. Access allows you to create<br />

more than one query, and you can save each query under a unique name. The <strong>SQL</strong> needed to create all<br />

the tables in the database is discussed in Chapter 1. So, this appendix takes you through a brief example<br />

of how to create a table, insert data, and then delete the table. However, because this is a book on <strong>SQL</strong>,<br />

you use <strong>SQL</strong> code to do all this, but you can use the user interface to perform these actions if you prefer.<br />

Type the following <strong>SQL</strong> into the Query textbox:<br />

CREATE TABLE MyTable (MyColumn int)<br />

Now execute the query by clicking the Run icon (a dark red exclamation mark) in the middle of the toolbar.<br />

Alternatively, from the main menu bar, you can select Run from the Query menu. Executing the<br />

query results in the creation of MyTable. If you switch back to the Tables view, you can see that MyTable<br />

has been added to the table list, as shown in Figure B-57:<br />

Figure B-57

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

Saved successfully!

Ooh no, something went wrong!