Yearly Archives: 2014

Except command in SQL Server

Except command in SQL Server returns the distinct values from the left query that are not also found on the right query. For Except command, below basic rules must be followed. The number and the order of the columns must … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged | 19 Comments

Like() function in SQL Server

Like:- This operator is used in a WHERE clause to search for a specific pattern in the values of the column. In this article, we are going to use the following table for the examples:- CREATE TABLE [dbo]. [Employee]([Empid] [Int] … Continue reading

Posted in SQL Functions, SQL Server | Tagged | 31 Comments

Best practices for Database Programming

1. All the tables in the database have properly defined relationship using primary keys and foreign keys .2. Indexes should be created on the tables as it increases the performance of the SQL Queries. 3. Find the indexes which need … Continue reading

Posted in SQL Best Practices, SQL Server | Tagged | 31 Comments

Intersection command in SQL Server

This function is used to returns distinct values that are returned by both the query on the left and right sides of the INTERSECT operand. For intersection command, below basic rules must be followed. The number and the order of … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged | 31 Comments

Exception handling in SQL Server

SQL server gives the exception/error handling mechanism which is similar to c#, Try..Catch block. In SQL Server, we can write the SQL Statements within the Try block and if any exception occurred control automatically goes to the group of SQL … Continue reading

Posted in Most Imp SQL Concepts, SQL Server, SQL Server Exception handling | Tagged | 31 Comments

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 … Continue reading

Posted in Interview Questions | Tagged | 30 Comments

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

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 … Continue reading

Posted in Interview Questions | Tagged | 31 Comments

Happy Holi

Holi is the time to unwind de-stress and bond with sweets,Thandai and colours.Come let’s rejuvenate by immersing ourselves in the colour of joy,happiness and laughter!Happy Holi!

Posted in Miscellaneous | Tagged | 32 Comments

Question of the Week – 11/1/2014

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 … Continue reading

Posted in Interview Questions | Tagged | 31 Comments

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

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 … Continue reading

Posted in Interview Questions | Tagged | 31 Comments