﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / T-SQL (SS2K8)  / Reg: Interview Questions / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 13:29:16 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>[quote][b]Kingston Dhasian (11/7/2012)[/b][hr][quote][b]CELKO (11/6/2012)[/b][hr]Now we have to track down this interview so we can tell them that you cheat. I have gotten two students and one lecturer kicked out of their schools for this kind of academic dishonesty. [/quote]How does the thread classify as "Academic dishonesty"?The OP is most probably a job seeker and not a student. He is asking this question after the interview to gain some knowledge which he doesn't have now.He would have been dishonest had he asked the question during the interview process which is highly unlikely.[/quote]Not at all unlikely.  See it happen all the time.That's why I always wait at least an hour from when these kinds of questions are posted before I post any sort of answer to the problem.  Assuming some of the questions are homework, as opposed to interviews/tests, I sometimes wait a full day.That way, if it's an honest "I came up short and I'd like some help so I can do better next time", they get what they need, but if it's a dishonest, "I'm in the middle of a test/interview and I'm trying to lie my way to (a better grade)/(a job I don't actually qualify for)", I'm not helping with that.Either way, this one is too vague to actually provide real answers to.  Are they trying to grab the value from the prior row?  Are they looking for val-1000?  Something else?  It's too vague.  In an interview, asked this exact question, I'd tell them my response would be, "The request is too vague.  I need to know the actual business rules being applied here.  Please contact the stakeholder and get the request clarified."</description><pubDate>Wed, 07 Nov 2012 06:34:32 GMT</pubDate><dc:creator>GSquared</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>[code="sql"]SELECT ID=ID,       NAME=NAME,       SALARY=SALARY,       SALARY2=(case when SALARY-1000=0 then null  else SALARY-1000 end)  FROM SalaryDetail              [/code]</description><pubDate>Wed, 07 Nov 2012 03:26:06 GMT</pubDate><dc:creator>carlosaamaral</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>The inner join wont work where Id 1 which needs to return a NULL value, based on the sample data provided, so you would need a Left outer join, to the prior record based on Id.</description><pubDate>Wed, 07 Nov 2012 02:38:36 GMT</pubDate><dc:creator>Jason-299789</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>Using inner join A.id=B.id-1Using cte expression and join</description><pubDate>Wed, 07 Nov 2012 02:33:57 GMT</pubDate><dc:creator>Sony Francis @EY</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>I think the question is to see if you know how to transpose rows to columns.</description><pubDate>Wed, 07 Nov 2012 02:25:23 GMT</pubDate><dc:creator>Abu Dina</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>I think they were probably testing your knowledge of Joins, it would be interesting to see what you think the solution is before putting up how I would have coded.</description><pubDate>Wed, 07 Nov 2012 02:07:07 GMT</pubDate><dc:creator>Jason-299789</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>[quote][b]CELKO (11/6/2012)[/b][hr]...Now we have to track down this interview so we can tell them that you cheat...dishonesty...[/quote]So, can you claim that you have never-ever lied yourself? ;-) I guess OP had the interview already, and couldn't answer the question he is asking to help with...</description><pubDate>Wed, 07 Nov 2012 01:52:34 GMT</pubDate><dc:creator>Eugene Elutin</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>[quote][b]CELKO (11/6/2012)[/b][hr]Now we have to track down this interview so we can tell them that you cheat. I have gotten two students and one lecturer kicked out of their schools for this kind of academic dishonesty. [/quote]How does the thread classify as "Academic dishonesty"?The OP is most probably a job seeker and not a student. He is asking this question after the interview to gain some knowledge which he doesn't have now.He would have been dishonest had he asked the question during the interview process which is highly unlikely.</description><pubDate>Wed, 07 Nov 2012 01:50:56 GMT</pubDate><dc:creator>Kingston Dhasian</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>[quote][b]vs.satheesh (11/6/2012)[/b][hr]I face one interview question.One salary table i have three column like (id,name,salary)Table Name:SalaryDetailid    name    salary1     arun     10002     jothi     20003     kavi      30004     rahul     40005     jeeva     5000In this above i want following resultid    name    salary    Salry21     arun     1000     null2     jothi     2000     10003     kavi      3000     20004     rahul     4000     30005     jeeva     5000    4000.Please reply this .[/quote]What is the business logic by which you got the 4th column( Salry2 )?Though it is a bit evident, it would be better if you put it in words as otherwise people would only be guessingAdditionally, if you include some code which you have come up with, we can be assured we are not spoon feeding you</description><pubDate>Wed, 07 Nov 2012 01:46:31 GMT</pubDate><dc:creator>Kingston Dhasian</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>&amp;gt;&amp;gt; I face one interview question.  One salary table I have three columns like (id,name,salary) &amp;lt;&amp;lt;Now we have to track down this interview so we can tell them that you cheat. I have gotten two students and one lecturer kicked out of their schools for this kind of academic dishonesty. Oh, you forgot the DDL that is minimal Netiquette. CREATE TABLE Salary_Details(emp_id INTEGER NOT NULL PRIMARY KEY, emp_name VARCHAR(25) NOT NULL, salary_amt DECIMAL (8,2) NOT NULL   CHECK ( salary_amt &amp;gt;= 0.00) );&amp;gt;&amp;gt; In this above I want following result &amp;lt;&amp;lt;What is the business rule for the computation? </description><pubDate>Tue, 06 Nov 2012 18:13:21 GMT</pubDate><dc:creator>CELKO</dc:creator></item><item><title>RE: Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>So, what do you have so far?</description><pubDate>Tue, 06 Nov 2012 17:01:36 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>Reg: Interview Questions</title><link>http://www.sqlservercentral.com/Forums/Topic1381751-392-1.aspx</link><description>I face one interview question.One salary table i have three column like (id,name,salary)Table Name:SalaryDetailid    name    salary1     arun     10002     jothi     20003     kavi      30004     rahul     40005     jeeva     5000In this above i want following resultid    name    salary    Salry21     arun     1000     null2     jothi     2000     10003     kavi      3000     20004     rahul     4000     30005     jeeva     5000    4000.Please reply this .</description><pubDate>Tue, 06 Nov 2012 16:59:14 GMT</pubDate><dc:creator>vs.satheesh</dc:creator></item></channel></rss>