Web Analytics Made Easy - Statcounter

Question of the Week

From today onwards I have added a new section in my blog “Question of the Week”. In this section, I will be going to ask SQL puzzle twice a week from all of you and after two days will gives the answer for that Question. So keep answering:-)

Question on 25/12/2013 :-

Suppose we have a table says tbl_students whose structure is given below:-

Create table tbl_students(Studentid int identity(1,1) , Studentname nvarchar(150))

Suppose it contains the following data:-

Read More

Answer for Question asked on 25/12/2013



Question on 28/12/2013:-

Question:- Suppose we have a table named tbl_charactername have only one column say “charactername”.
It contains 10 rows. First 5 rows contains “Vivek Johari” and the next 5 rows contains “Abhinav Golwalkar”
tbl_charactername
———————
Vivek Johari
Vivek Johari
Vivek Johari
Vivek Johari
Vivek Johari
Abhinav Golwalkar
Abhinav Golwalkar
Abhinav Golwalkar
Abhinav Golwalkar
Abhinav Golwalkar
Now we need a SQL Query which can return the result in the form
Raad More..


Question of the Week -08/04/2014

Suppose we need to find out the name of all the months in a given year (Year will be given as an input parameter) where first day of the month falls on weekend (Saturday or Sunday). 
So what should be the query/stored procedure to get the above result?

DMCA.com

6 Comments