?
Solved

statement code to find state capitals

Posted on 2011-05-12
1
Medium Priority
?
368 Views
Last Modified: 2012-05-11
How do I code the following statement:

What are the capitals of the following states:  Alabama, Washington, and California?
0
Comment
Question by:KayMJay
1 Comment
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 35747370
lots of different possible ways, but they all come down to one basic idea.

the capital must be stored somewhere with state as an identifying characteristic.

That could be XML with state nodes and capital attributes
state nodes with capital subnodes

relational tables with states and capital child tables
or a single table

the last option is probably the simplest and might look something like this...

select state, capital from state_table
where state in ('Alabama','Washington','California')
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"Disruption" is the most feared word for C-level executives these days. They agonize over their industry being disturbed by another player - most likely by startups.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question