Web Analytics Made Easy - Statcounter

Question of the Week -08/04/2014

blank

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?

Answer – Objective Question (How many Null values in an unique constraint can be inserted in SQL Server)

blank

Question:- How many NULL value allowed in a column in which Unique constraint is defined in SQL Server? Options:- a) 1 b) 2 c) More than 1 Answer :- Option a) 1 In SQL Server, we can Insert only one null value in a column where we have defined the Unique Constraint. For Example , suppose … Read more

Question of the Week – 11/1/2014

blank

Question:- Suppose there are two tables A and B and we need to write 3 SQL queries which returns the record set as shown in the below figure. First Query:- In this case, you have to write a SQL Query using SQL JOIN which return the data which is not common to these two tables A& B as shown in … Read more

Answer – Objective Question (In which database temporary tables are created in SQL Server)

blank

Question :- In which database temporary tables are created in SQL Server? 1) User database (where temporary table are defined)     2) Master database     3) TempDB (Correct Answer) 4) Model Database 5) None of the above Answer  Thanks to all who attempted this question. 84% people gives the correct answer:-) Correct answer … Read more

Answer -Question of the Week – 2/1/2014 – Question 1

blank

Question :- Suppose we have to design a database in which employees can work on multiple projects.There are many designation defined in the organization to which each employee can belongs.   For example, Software engineer, Team lead, Project Manager, Project lead, QC engineer, QC Lead, QC manager etc. An employee can belong to one designation … Read more

Answer – Objective Question (Which table is called Heap table in SQL Server)

blank

Question:-    Which table is called Heap table in SQL Server. 1) Table without any indexes 2) Table without any clustered index (Correct Answer) 3) Table without any non clustered Index 4) None of the above Many people attempted this question and mostly gives the correct answer. The correct answer is option 2 ( Table … Read more

Question of the Week – 2/1/2014 – Question 1

blank

Question :- Suppose we have to design a database in which employees can work on multiple projects.There are many designation defined in the organization to which each employee can belongs.  For example, Software engineer, Team lead, Project Manager, Project lead, QC engineer, QC Lead, QC manager etc. An employee can belong to one designation at … Read more

Answer – Objective Question (Number of non clustered indexes possible on a Table in SQL Server 2008R2)

blank

Question :-  How many non clustered indexes are possible in a table in SQL Server 2008R2 1)  1 2) 249 3) 999  (Correct answer) 4) None of these Explanation  21 people gives answer to this Question and most of them is correct. Correct answer is 999 (Option 4). In SQL Server 2008 onwards, we can … Read more

Answer – Question of the Week – 28/12/2013 – Question 2

blank

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 … Read more

Answer -Question of the Week – 25/12/2013- Question 1

blank

Question:- 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:- Studentid  Studentname 1               Vivek Johari 2               Chandra Singh 4           … Read more