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.

Chapter 3<br />

❑ The slightly tricky topic of selecting data from more than one table. Up to that point, you could<br />

use only one table to create the final results set. However, using the INNER JOIN statement<br />

allows you to link two or more tables to form a new results set.<br />

❑ The NULL value, which is not the same as no value or zero but in fact signifies an unknown<br />

value. The NULL value can cause problems when selecting data, however, because when comparing<br />

an unknown value to any other value, the result is always unknown and not included in<br />

the final results. You must use the IS NULL or IS NOT NULL operators in order to check for a<br />

NULL value.<br />

The next chapter returns to database design, this time looking at it in more depth and covering some of<br />

the issues not yet covered. This chapter, however, completes the introductory portion of this book;<br />

you’re now ready to get out there and create your own databases and get your own results! The second<br />

half of the book covers more advanced topics, with the aim of developing your <strong>SQL</strong> skills.<br />

Exercises<br />

116<br />

For each of the following exercise questions, write the <strong>SQL</strong> to list the answers:<br />

1. What is William Doors’s (MemberId 13) address?<br />

2. Which members have a surname beginning with the letter J?<br />

3. Which members joined before December 31, 2004? Order the results by last name and then by<br />

first name.<br />

4. List all the members who attended meetings in Windy Village, Golden State.

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

Saved successfully!

Ooh no, something went wrong!