<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux, Programming, Telephony, Asterisk, Apache, Tips &#38; Tricks &#187; language</title>
	<atom:link href="http://shahidz.com/tag/language/feed/" rel="self" type="application/rss+xml" />
	<link>http://shahidz.com</link>
	<description>Passionate About Technology</description>
	<lastBuildDate>Sun, 10 Jan 2010 17:38:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting Up the world Database (Countries, States, Cites, etc)</title>
		<link>http://shahidz.com/setting-up-the-world-database-countries-states-cites-etc/</link>
		<comments>http://shahidz.com/setting-up-the-world-database-countries-states-cites-etc/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 06:04:19 +0000</pubDate>
		<dc:creator>Shahid</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[cities]]></category>
		<category><![CDATA[countris]]></category>
		<category><![CDATA[district]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[population]]></category>
		<category><![CDATA[states]]></category>

		<guid isPermaLink="false">http://shahidz.com/setting-up-the-world-database-countries-states-cites-etc/</guid>
		<description><![CDATA[In certain applications we need the details of all the counties in the world, all the states in in each country and the capital of all the country.  And it is difficult to create all theses information&#8217;s manually. But mysql provide a file world.sql which contains sample data for a     world [...]]]></description>
			<content:encoded><![CDATA[<p>In certain applications we need the details of all the counties in the world, all the states in in each country and the capital of all the country.  And it is difficult to create all theses information&#8217;s manually. But mysql provide a file <font color="#800080"><code class="filename">world.sql</code></font> which contains sample data for a     <code class="literal">world</code> database that you can play with. This file contains names of all the Countries in the world, States, Cities, etc.  The file     is available for download from the mysql site <a href="http://dev.mysql.com/doc" target="_blank">http://dev.mysql.com/doc</a>. For more details about <font color="#800080">world.sql</font> visit the site <a href="http://dev.mysql.com/doc/world-setup/en/world-setup.html" target="_blank">http://dev.mysql.com/doc/world-setup/en/world-setup.html</a>.</p>
<p>To load the contents of the <code class="filename">world.sql</code> file into     MySQL, use the following procedure:</p>
<ol type="1">
<li>         Change directory to where the <code class="filename">world.sql</code>         file is locatedIf your current directory is not the same as the location of the         <code class="filename">world.sql</code> file, use a <span><strong class="command">cd</strong></span>         command to change location.</li>
<li>         Connect to the MySQL server using the <span><strong class="command">mysql</strong></span>         programAt your command-line prompt, issue this command:
<pre class="programlisting">shell&gt; <strong class="userinput"><code>mysql -u root</code></strong></pre>
<p>This command connects to the server using the MySQL         <code class="literal">root</code> account to make sure that you&#8217;ll have         permission to create the <code class="literal">world</code> database. The         <code class="option">--p</code> option tells <span><strong class="command">mysql</strong></span> to         prompt you for the <code class="literal">root</code> password. Enter the         password when prompted. (Remember that the MySQL         <code class="literal">root</code> account is not the same as the operating         system <code class="literal">root</code> account and probably will have a         different password.)</li>
</ol>
<ol type="1">
<li value="3">         Create the <code class="literal">world</code> database and select it as         the default database:In the <span><strong class="command">mysql</strong></span> program, issue the following         statements:
<pre class="programlisting">mysql&gt; <strong class="userinput"><code>CREATE DATABASE world;</code></strong>
mysql&gt; <strong class="userinput"><code>USE world</code></strong></pre>
</li>
<li>         Load the contents of <code class="filename">world.sql</code> into the         <code class="literal">world</code> databaseIssue a <code class="literal">SOURCE</code> command to tell         <span><strong class="command">mysql</strong></span> to read and process the contents of         <code class="filename">world.sql</code>:
<pre class="programlisting">mysql&gt; <strong class="userinput"><code>SOURCE world.sql</code></strong></pre>
<p>You&#8217;ll see quite a bit of output as <span><strong class="command">mysql</strong></span>         reads queries from the <code class="filename">world.sql</code> file and         executes them.</li>
</ol>
<p>After <span><strong class="command">mysql</strong></span> finishes processing the     <code class="filename">world.sql</code> file, try this statement:</p>
<pre class="programlisting">mysql&gt; <strong class="userinput"><code>SHOW TABLES;</code></strong>
+-----------————————--------------+
| Tables_in_world |
+-----------————————--------------+
| City            |
| Country         |
| CountryLanguage |
+-----------————————--------------+</pre>
<p class="itemizedlist">The <code class="literal">world</code> tables contain the following types of     information:</p>
<ul>
<li>         <code class="literal">Country</code>: Information about countries of the         world.</li>
<li>         <code class="literal">City</code>: Information about some of the cities in         those countries.</li>
<li>         <code class="literal">CountryLanguage</code>: Languages spoken in each         country.</li>
</ul>
<p>To see what columns each table contains, use     <code class="literal">DESCRIBE</code>. For example:</p>
<pre class="programlisting">mysql&gt; <strong class="userinput"><code>DESCRIBE Country;</code></strong>
mysql&gt; <strong class="userinput"><code>DESCRIBE City;</code></strong>
mysql&gt; <strong class="userinput"><code>DESCRIBE CountryLanguage</code></strong></pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fshahidz.com%2Fsetting-up-the-world-database-countries-states-cites-etc%2F&amp;linkname=Setting%20Up%20the%20world%20Database%20%28Countries%2C%20States%2C%20Cites%2C%20etc%29"><img src="http://shahidz.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://shahidz.com/setting-up-the-world-database-countries-states-cites-etc/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
