SQL SERVER INTERVIEW QUERY WITH EXAMPLE 4 FRESHER AND EXP : SET-2 WITH SOLUTION
Hey, this is Set 2 of SQL Query series, This set is for 0-2 years experienced developers if you have more than 2 years exp. then don't think that this set is not for you here you can remind many things, if you think that you can answer every query here then try and leave a comment honestly and after that check your answer in the Solution set. This is a question set only.
To see the solution follow the link which exists at the end of this post. If you want the Sql server query interview question pdf then wait for some days, we will soon come up with pdf. which will contain more than 100 sql server queries with solutions.
To see the solution follow the link which exists at the end of this post. If you want the Sql server query interview question pdf then wait for some days, we will soon come up with pdf. which will contain more than 100 sql server queries with solutions.
So let's try this set.
SQL SERVER QUERY INTERVIEW QUESTION SET : 2
Related Tables:-
Questions Answers
11). Get all employee detail from EmployeeDetail table whose "FirstName" not start with any single character between 'a-p'
Ans: SELECT * FROM [EmployeeDetail] WHERE FirstName like '[^a-p]%'
12). Get all employee detail from EmployeeDetail table whose "Gender" end with 'le' and contain 4 letters. The Underscore(_) Wildcard Character represents any single character.
Ans: SELECT * FROM [EmployeeDetail] WHERE Gender like '__le' --there are two "_"
13). Get all employee detail from EmployeeDetail table whose "FirstName" start with 'A' and contain 5 letters.
Ans: SELECT * FROM [EmployeeDetail] WHERE FirstName like 'A____' --there are four "_"
14). Get all employee detail from EmployeeDetail table whose "FirstName" containing '%'. ex:-"Vik%as".
Ans: SELECT * FROM [EmployeeDetail] WHERE FirstName like '%[%]%'
--According to our table it would
return 0 rows, because no name containg '%'
15). Get all unique "Department" from EmployeeDetail table.
Ans: SELECT DISTINCT(Department) FROM [EmployeeDetail]
16). Get the highest "Salary" from EmployeeDetail table.
Ans: SELECT MAX(Salary) FROM [EmployeeDetail]
17). Get the lowest "Salary" from EmployeeDetail table.
Ans: SELECT MIN(Salary) FROM [EmployeeDetail]
***SQL SERVER DATE RELATED INTERVIEW QUERY***
18). Show "JoiningDate" in "dd mmm yyyy" format, ex- "15 Feb 2013"
Ans: SELECT CONVERT(VARCHAR(20),JoiningDate,106) FROM [EmployeeDetail]
19). Show "JoiningDate" in "yyyy/mm/dd" format, ex- "2013/02/15"
Ans: SELECT CONVERT(VARCHAR(20),JoiningDate,111) FROM [EmployeeDetail]
20). Show only time part of the "JoiningDate".
Ans: SELECT CONVERT(VARCHAR(20),JoiningDate,108) FROM [EmployeeDetail]
Click on the following link for NEXT SET OF QUESTIONS:
CLICK HERE FOR NEST SET (MORE THAN 100 QUERIES)
This comment has been removed by the author.
ReplyDeleteExplain 108,106,111
ReplyDelete13 and 14 were copypasted from 12 and comments were not corrected per example.
ReplyDeleteAs a result both contain phrase « --there are two "_" »
In reality 13 should state « -- there are four "_" » and 14 should have nothing - there are no underscores there.
For Date Refer this , http://www.w3schools.com/sql/func_convert.asp
ReplyDelete@Paral Thnx
ReplyDeleteCorrected...
Se.sachin92@Gmail.com
ReplyDeletevery nice questions
I want some SQL queries ralted to fresher and experience interview question.
ReplyDeleteThis is m mail I'd: santoshpulakala@gmail.com.
Plz send me sir...
hi,
ReplyDeletePls send me the pdf.emailparthi@gmail.com
hii.... plz send me d pdf for sql
ReplyDeletemail id- rahejaanubhav03@gmail.com
hii.... plz send me d pdf for sql
ReplyDeletemail id-ramya.karini59@gmail.com
nice queries
ReplyDeleteCan u please mail me the pdf for sql questions
ReplyDeletesejal_hemal@yahoo. Com
Thanks
Can you give me answer of Question number 11 in plsql Please
ReplyDeletecan you please mail pdf over my mailid "atcsupport@skyproductivity.com"
ReplyDeleteCan you please email me pdf for 2-3 yrs experienced on sahil82@gmail.com
ReplyDeleteCan you please email me pdf for 2-3 yrs experienced on sahil82@gmail.com
ReplyDeleteHi Vikash, I'm a 1.6 year experience guy working on MS SQL SERVER, your post very useful for me up to SET-1 to SET-10 So can u mail me PDF's to myid : jsreddy2286@outlook.com
ReplyDeletejeripothulajsreddy@gmail.com
hi maahi mehta i m fresher can you please send me pdf sql queries and question too. my id is maahi.mehta.08@outlook.com
ReplyDeletecan you please explain the date format conversion. Are the styles/date format code(106,108 etc.) pre-defined and we have to remember them individually or there is some logic.
ReplyDeleteit is better if we get the DDL & DML query for the example table.
ReplyDeleteIN 18TH QUS..IN ANS: WHAT IS '106' REPRESENT.
ReplyDelete'106' IS THE DATE FORMAT CODE FOR SPECIFIC FORMAT, THERE ARE MANY CODE FOR DIFF-DIFF DATE FORMAT. YOU CAN TRY OTHER ALSO.
DeleteI want some new query as fresher and experiance.
ReplyDeletethis is my mail id like-prasantakmr2@gmail.com
hi,
ReplyDeleteCan u please help m out with Poc SQL practice questions
Can u please mail me the pdf for sql questions
ReplyDeletePriyaswamy06@gmail.com
Thanks
its very usefull
ReplyDeletein above 18th question we may write query like this
ReplyDeleteselect extract(hiredate,'dd-mon-yyyy') from emp;
or
select to_char(to_date(hiredate),'dd_mon_yyyy') from emp;
is this write or wrong?
good
ReplyDeletehai sir can you please share me the PDF of sql interview Q & A @shabashi2482@gmial.com
ReplyDeleteas a fresher i am searchig for job
Explain 18 19 20 questions pls
ReplyDelete