<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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: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>Comments on: SQL SERVER &#8211; 2008 &#8211; Interview Questions and Answers &#8211; Part 3</title>
	<atom:link href="http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Wed, 19 Jun 2013 15:04:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Vadivel Mohanakrishnan</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-173813</link>
		<dc:creator><![CDATA[Vadivel Mohanakrishnan]]></dc:creator>
		<pubDate>Sat, 01 Oct 2011 10:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-173813</guid>
		<description><![CDATA[Clustered index doesn’t change the physical order of the table. Check out my blog post which has sample scripts to know how the data is stored internally.

http://vadivel.blogspot.com/2011/09/does-clustered-index-physically-orders.html]]></description>
		<content:encoded><![CDATA[<p>Clustered index doesn’t change the physical order of the table. Check out my blog post which has sample scripts to know how the data is stored internally.</p>
<p><a href="http://vadivel.blogspot.com/2011/09/does-clustered-index-physically-orders.html" rel="nofollow">http://vadivel.blogspot.com/2011/09/does-clustered-index-physically-orders.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Padma</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-163180</link>
		<dc:creator><![CDATA[Padma]]></dc:creator>
		<pubDate>Mon, 29 Aug 2011 10:43:16 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-163180</guid>
		<description><![CDATA[I observe few questions appearing very rarely on other sites....Thanks Pinal]]></description>
		<content:encoded><![CDATA[<p>I observe few questions appearing very rarely on other sites&#8230;.Thanks Pinal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumud sharma</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-131917</link>
		<dc:creator><![CDATA[kumud sharma]]></dc:creator>
		<pubDate>Fri, 29 Apr 2011 05:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-131917</guid>
		<description><![CDATA[hi Sir,

I would like to learn how  logs can be used to roll back delete ,update etc in table .

thanks and regards]]></description>
		<content:encoded><![CDATA[<p>hi Sir,</p>
<p>I would like to learn how  logs can be used to roll back delete ,update etc in table .</p>
<p>thanks and regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anoop</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-103956</link>
		<dc:creator><![CDATA[Anoop]]></dc:creator>
		<pubDate>Mon, 06 Dec 2010 09:46:39 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-103956</guid>
		<description><![CDATA[Hi,

Can you please help me to log in to this team?]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Can you please help me to log in to this team?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anoop</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-103951</link>
		<dc:creator><![CDATA[Anoop]]></dc:creator>
		<pubDate>Mon, 06 Dec 2010 09:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-103951</guid>
		<description><![CDATA[Hi Can you please help to join this group. and also please let me know if your coordinating any sessions in bangalore.]]></description>
		<content:encoded><![CDATA[<p>Hi Can you please help to join this group. and also please let me know if your coordinating any sessions in bangalore.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sanindra kumar sunny</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-75518</link>
		<dc:creator><![CDATA[sanindra kumar sunny]]></dc:creator>
		<pubDate>Thu, 10 Jun 2010 18:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-75518</guid>
		<description><![CDATA[a sub query which returns multiple columns:
i am writtin this query on northwind database----
select orderid,orderdate,customerid from orders
where customerid IN (select customerid from customers)]]></description>
		<content:encoded><![CDATA[<p>a sub query which returns multiple columns:<br />
i am writtin this query on northwind database&#8212;-<br />
select orderid,orderdate,customerid from orders<br />
where customerid IN (select customerid from customers)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Interview Questions &#38; Answers Needs Your Help Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-63213</link>
		<dc:creator><![CDATA[SQL SERVER – Interview Questions &#38; Answers Needs Your Help Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Fri, 19 Mar 2010 01:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-63213</guid>
		<description><![CDATA[[...] SQL SERVER – 2008 – Interview Questions and Answers – Part 3 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – 2008 – Interview Questions and Answers – Part 3 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gpshiburaj</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-57840</link>
		<dc:creator><![CDATA[gpshiburaj]]></dc:creator>
		<pubDate>Mon, 23 Nov 2009 17:45:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-57840</guid>
		<description><![CDATA[hi pinal
I like you to please explain &quot;If you do not use TRANSACTION you can not use logs to roll back TRUNCATE&quot;

1,For a normal update statement, is it possible to use logs to roll back, if yes how is it done, can you please explain with examples. 

2, how do we use log files to restore backups. Please explain with examples.

Thanks in advance]]></description>
		<content:encoded><![CDATA[<p>hi pinal<br />
I like you to please explain &#8220;If you do not use TRANSACTION you can not use logs to roll back TRUNCATE&#8221;</p>
<p>1,For a normal update statement, is it possible to use logs to roll back, if yes how is it done, can you please explain with examples. </p>
<p>2, how do we use log files to restore backups. Please explain with examples.</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-55146</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Mon, 24 Aug 2009 03:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-55146</guid>
		<description><![CDATA[@Vimal Kumar, 

I assume when we say a Multi Column Sub Query we are talking about an alias table. Let&#039;s see this with an example. 

-- First Tables store static data about employee details
Create Table #Example1 ( Eid int , Ename varchar(10))
insert into #Example1 values ( 1, &#039;Mr W&#039;)
insert into #Example1 values ( 2, &#039;Mr X&#039;)
insert into #Example1 values ( 3, &#039;Mr Y&#039;)
insert into #Example1 values ( 4, &#039;Mr Z&#039;)

--Second Table stores sales data, how much sales each employee made each month..
Create Table #Example2 ( Eid int , Sales_Made int , date datetime ) 
insert into #Example2 values ( 1, 10 , &#039;06/30/2006&#039;)
insert into #Example2 values ( 1, 15 , &#039;07/30/2009&#039;)
insert into #Example2 values ( 1, 20 , &#039;08/30/2008&#039;)
insert into #Example2 values ( 1, 30 , &#039;07/30/2009&#039;)

insert into #Example2 values ( 2, 15 , &#039;06/30/2006&#039;)
insert into #Example2 values ( 2, 14 , &#039;09/30/2007&#039;)
insert into #Example2 values ( 2, 23 , &#039;07/30/2009&#039;)
insert into #Example2 values ( 2, 32 , &#039;07/30/2009&#039;)

insert into #Example2 values ( 3, 12 , &#039;07/30/2009&#039;)
insert into #Example2 values ( 3, 13 , &#039;09/30/2007&#039;)
insert into #Example2 values ( 3, 24 , &#039;08/30/2008&#039;)
insert into #Example2 values ( 3, 32 , &#039;07/30/2009&#039;)

insert into #Example2 values ( 4, 13 , &#039;06/30/2006&#039;)
insert into #Example2 values ( 4, 15 , &#039;07/30/2009&#039;)
insert into #Example2 values ( 4, 25 , &#039;08/30/2008&#039;)
insert into #Example2 values ( 4, 34 , &#039;07/30/2009&#039;)


-- You want to see total sales made by each employee in last month.
-- There could be many other ways to solve this, it is only to show you multi column subquery I opted this route.
Select	A.Eid
		,A.Ename
		,B.Total_Sales
		,B.Last_Month
FROM	#Example1 A JOIN 
 -- Start of Multi Column Sub Query 
(
select	Eid
		,SUM(Sales_Made) Total_Sales
		,Max (Date) Last_Month
from	#Example2 
group by Eid 
) -- End of Multi Column Sub Query 
B ON A.Eid = B.Eid 

drop table #Example1 , #Example2


~ IM.]]></description>
		<content:encoded><![CDATA[<p>@Vimal Kumar, </p>
<p>I assume when we say a Multi Column Sub Query we are talking about an alias table. Let&#8217;s see this with an example. </p>
<p>&#8211; First Tables store static data about employee details<br />
Create Table #Example1 ( Eid int , Ename varchar(10))<br />
insert into #Example1 values ( 1, &#8216;Mr W&#8217;)<br />
insert into #Example1 values ( 2, &#8216;Mr X&#8217;)<br />
insert into #Example1 values ( 3, &#8216;Mr Y&#8217;)<br />
insert into #Example1 values ( 4, &#8216;Mr Z&#8217;)</p>
<p>&#8211;Second Table stores sales data, how much sales each employee made each month..<br />
Create Table #Example2 ( Eid int , Sales_Made int , date datetime )<br />
insert into #Example2 values ( 1, 10 , &#8217;06/30/2006&#8242;)<br />
insert into #Example2 values ( 1, 15 , &#8217;07/30/2009&#8242;)<br />
insert into #Example2 values ( 1, 20 , &#8217;08/30/2008&#8242;)<br />
insert into #Example2 values ( 1, 30 , &#8217;07/30/2009&#8242;)</p>
<p>insert into #Example2 values ( 2, 15 , &#8217;06/30/2006&#8242;)<br />
insert into #Example2 values ( 2, 14 , &#8217;09/30/2007&#8242;)<br />
insert into #Example2 values ( 2, 23 , &#8217;07/30/2009&#8242;)<br />
insert into #Example2 values ( 2, 32 , &#8217;07/30/2009&#8242;)</p>
<p>insert into #Example2 values ( 3, 12 , &#8217;07/30/2009&#8242;)<br />
insert into #Example2 values ( 3, 13 , &#8217;09/30/2007&#8242;)<br />
insert into #Example2 values ( 3, 24 , &#8217;08/30/2008&#8242;)<br />
insert into #Example2 values ( 3, 32 , &#8217;07/30/2009&#8242;)</p>
<p>insert into #Example2 values ( 4, 13 , &#8217;06/30/2006&#8242;)<br />
insert into #Example2 values ( 4, 15 , &#8217;07/30/2009&#8242;)<br />
insert into #Example2 values ( 4, 25 , &#8217;08/30/2008&#8242;)<br />
insert into #Example2 values ( 4, 34 , &#8217;07/30/2009&#8242;)</p>
<p>&#8211; You want to see total sales made by each employee in last month.<br />
&#8211; There could be many other ways to solve this, it is only to show you multi column subquery I opted this route.<br />
Select	A.Eid<br />
		,A.Ename<br />
		,B.Total_Sales<br />
		,B.Last_Month<br />
FROM	#Example1 A JOIN<br />
 &#8212; Start of Multi Column Sub Query<br />
(<br />
select	Eid<br />
		,SUM(Sales_Made) Total_Sales<br />
		,Max (Date) Last_Month<br />
from	#Example2<br />
group by Eid<br />
) &#8212; End of Multi Column Sub Query<br />
B ON A.Eid = B.Eid </p>
<p>drop table #Example1 , #Example2</p>
<p>~ IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vimal Kumar</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-55134</link>
		<dc:creator><![CDATA[Vimal Kumar]]></dc:creator>
		<pubDate>Sun, 23 Aug 2009 11:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-55134</guid>
		<description><![CDATA[Hi 

Can you give an example of a Multi Column Sub Query??

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>Can you give an example of a Multi Column Sub Query??</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jitendra</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-54719</link>
		<dc:creator><![CDATA[Jitendra]]></dc:creator>
		<pubDate>Tue, 11 Aug 2009 06:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-54719</guid>
		<description><![CDATA[Hi all,

Multiple column sub-query, where the sub-query returns multiple columns

can give an example for this

Thanks]]></description>
		<content:encoded><![CDATA[<p>Hi all,</p>
<p>Multiple column sub-query, where the sub-query returns multiple columns</p>
<p>can give an example for this</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kishore</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-52501</link>
		<dc:creator><![CDATA[kishore]]></dc:creator>
		<pubDate>Thu, 28 May 2009 05:05:34 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-52501</guid>
		<description><![CDATA[where clause is applied on the base table

Having is applied on the result set]]></description>
		<content:encoded><![CDATA[<p>where clause is applied on the base table</p>
<p>Having is applied on the result set</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asharaf Ali</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-51269</link>
		<dc:creator><![CDATA[Asharaf Ali]]></dc:creator>
		<pubDate>Fri, 24 Apr 2009 14:01:08 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-51269</guid>
		<description><![CDATA[ORDER BY clause can be used in a sub query if TOP keyword is specified. It is mentioned in your answers as wrong.]]></description>
		<content:encoded><![CDATA[<p>ORDER BY clause can be used in a sub query if TOP keyword is specified. It is mentioned in your answers as wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry Hung</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-43257</link>
		<dc:creator><![CDATA[Jerry Hung]]></dc:creator>
		<pubDate>Thu, 25 Sep 2008 20:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-43257</guid>
		<description><![CDATA[I just started reading the PDF, and was about to post the question. Good thing you addressed it already, Pinal

Thanks]]></description>
		<content:encoded><![CDATA[<p>I just started reading the PDF, and was about to post the question. Good thing you addressed it already, Pinal</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-42782</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Sun, 14 Sep 2008 10:32:09 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-42782</guid>
		<description><![CDATA[Imran Mohammed,

You are correct.

If you use TRANSACTION you can roll back TRUNCATE.

If you do not use TRANSACTION you can not use logs to roll back TRUNCATE. 

DELETE can be rolled back in either condition.

I have in depth discussed this issue. If you can click on (Read More Here) link there is discussion about the same issue.

http://blog.sqlauthority.com/2007/12/26/sql-server-truncate-cant-be-rolled-back-using-log-files-after-transaction-session-is-closed/

Again, your comment is first comment in this article and readers will be not confused after reading them.

Kind Regards,
Pinal Dave ( http://blog.sqlauthority.com )]]></description>
		<content:encoded><![CDATA[<p>Imran Mohammed,</p>
<p>You are correct.</p>
<p>If you use TRANSACTION you can roll back TRUNCATE.</p>
<p>If you do not use TRANSACTION you can not use logs to roll back TRUNCATE. </p>
<p>DELETE can be rolled back in either condition.</p>
<p>I have in depth discussed this issue. If you can click on (Read More Here) link there is discussion about the same issue.</p>
<p><a href="http://blog.sqlauthority.com/2007/12/26/sql-server-truncate-cant-be-rolled-back-using-log-files-after-transaction-session-is-closed/" rel="nofollow">http://blog.sqlauthority.com/2007/12/26/sql-server-truncate-cant-be-rolled-back-using-log-files-after-transaction-session-is-closed/</a></p>
<p>Again, your comment is first comment in this article and readers will be not confused after reading them.</p>
<p>Kind Regards,<br />
Pinal Dave ( <a href="http://blog.sqlauthority.com" rel="nofollow">http://blog.sqlauthority.com</a> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2008/09/14/sql-server-2008-interview-questions-and-answers-part-3/#comment-42779</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Sun, 14 Sep 2008 05:11:49 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=993#comment-42779</guid>
		<description><![CDATA[Hello, 

This is regarding truncate and delete....

I dont know if you cannot rollback truncate by default... but if you use begin tran with truncate statement then Yes you can rollback. 

Please clarify,,, I can be wrong as well... 

This is my example : 

create table example1 ( eid int ) 
go
insert into example1 values ( 1)
insert into example1 values ( 2)
insert into example1 values ( 3)
go
select * from example1 
go
begin tran T1
truncate table example1 
go
select * from example1 
go
rollback tran T1 
go
begin Tran T2 
delete from example1 where eid = 1
select * from example1 
go
rollback tran T2
go
select * from example1 
go

Thanks.
Imran.]]></description>
		<content:encoded><![CDATA[<p>Hello, </p>
<p>This is regarding truncate and delete&#8230;.</p>
<p>I dont know if you cannot rollback truncate by default&#8230; but if you use begin tran with truncate statement then Yes you can rollback. </p>
<p>Please clarify,,, I can be wrong as well&#8230; </p>
<p>This is my example : </p>
<p>create table example1 ( eid int )<br />
go<br />
insert into example1 values ( 1)<br />
insert into example1 values ( 2)<br />
insert into example1 values ( 3)<br />
go<br />
select * from example1<br />
go<br />
begin tran T1<br />
truncate table example1<br />
go<br />
select * from example1<br />
go<br />
rollback tran T1<br />
go<br />
begin Tran T2<br />
delete from example1 where eid = 1<br />
select * from example1<br />
go<br />
rollback tran T2<br />
go<br />
select * from example1<br />
go</p>
<p>Thanks.<br />
Imran.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
