<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mild Speaker</title>
	<atom:link href="http://hira81.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hira81.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 21 Nov 2008 17:06:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hira81.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Mild Speaker</title>
		<link>http://hira81.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hira81.wordpress.com/osd.xml" title="Mild Speaker" />
	<atom:link rel='hub' href='http://hira81.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Practice patience to feel the SQL’s power…</title>
		<link>http://hira81.wordpress.com/2008/11/21/practice-patience-to-feel-the-sql%e2%80%99s-power%e2%80%a6/</link>
		<comments>http://hira81.wordpress.com/2008/11/21/practice-patience-to-feel-the-sql%e2%80%99s-power%e2%80%a6/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 17:06:59 +0000</pubDate>
		<dc:creator>hira81</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hira81.wordpress.com/?p=4</guid>
		<description><![CDATA[Few days back one of my peers went through a recruitment interview. He was given some SQL challenges to solve and he solved all except the following one:   SQL&#62; select emp_name   2  from employee;   EMP_NAME &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Rajesh Chakrabarti     He was told to show it like: Rajesh Chakrabarti   Somehow he [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hira81.wordpress.com&amp;blog=5159646&amp;post=4&amp;subd=hira81&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Few days back one of my peers went through a recruitment interview. He was given some SQL challenges to solve and he solved all except the following one:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">SQL&gt; select emp_name</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>  </span>2<span>  </span>from employee;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">EMP_NAME</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Rajesh Chakrabarti</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">He was told to show it like:</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Rajesh </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Chakrabarti</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Somehow he was failed to solve this within the given time. Next day when he told me, we both tried it and solved it in different ways writing some clumsy code (containing more then 15 lines of PL/SQL code).</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Then this technique came in mind…</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">SQL&gt; select replace(emp_name,&#8217; &#8216;,chr(10)) AS emp_name</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>  </span>2<span>  </span>from employee;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">EMP_NAME</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Rajesh</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Charabarti</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Simple solution, spaces are replaced by a Return [chr(10)].</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">The lesson we learned is: <em>SQL’s power is sometimes ignored, we should think twice before moving toward PL/SQL.</em></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hira81.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hira81.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hira81.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hira81.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hira81.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hira81.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hira81.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hira81.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hira81.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hira81.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hira81.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hira81.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hira81.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hira81.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hira81.wordpress.com&amp;blog=5159646&amp;post=4&amp;subd=hira81&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hira81.wordpress.com/2008/11/21/practice-patience-to-feel-the-sql%e2%80%99s-power%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0be2f53185258f9a9a2c263d7f561d74?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hira81</media:title>
		</media:content>
	</item>
	</channel>
</rss>
