Author Archives: vivekjohari

About vivekjohari

Database Consultant with more than 11.5 years of experience in database designing & programming and DBA related activities.  Had good experience on different databases like SQL Server, MySQL & Oracle, Azure SQL &  Big Data.

Question of the Month (July)

Question of the Month Suppose we have a table emp_plan  which contains 4 columns “Empid” (employeeid), Planid (Projectid), Startdate(Allocation Start date) and Enddate (Allocation Enddate). Its structure is given below:-4  Create table emp_plan (empid nvarchar(200),planid nvarchar(20),startdate datetime, enddate datetime) Also below … Continue reading

Posted in Interview Questions | Tagged , | 23 Comments

Do you know about Whatsapp web?

Whatsapp claims that they currently have 500 million users worldwide. That is pretty impressive looking at the good amount of distinctively decent competitors they have within the space of Social Networking communication. Viber, Line, Google Hangout,Facebook Messenger & Hike (Commonly in India). While all these products … Continue reading

Posted in Miscellaneous | Tagged , , , | 23 Comments

Script to find complete months between two given dates

Complete months between two given dates Below script will help in finding the complete months within the 2 given dates. In the below script we takes below dates as exampleStartdate =2015-07-05 Enddate =2016-01-06 /**********************Script Start**************************/ IF (object_id(‘tempdb..#month’) is not null) … Continue reading

Posted in Interview Questions, SQL Basic, SQL Server | Tagged , , | Leave a comment

Script to find the complete weeks within two given dates

Complete weeks within two given dates Sometimes we need to find out the complete weeks within two given dates. Below script will help in finding the complete weeks within 2 given dates. In this script, I have used below dates … Continue reading

Posted in Interview Questions, SQL Basic, SQL Server, SQL Tips | Tagged , | 21 Comments

Importance of Best Practices in database programming

Best Practices in database programming For any programming language, just writing the code is not well enough. It should be written using the best practices. This article Best Practices in database programming  I will try to explain the disadvantages of … Continue reading

Posted in SQL Advanced, SQL Best Practices, SQL Server | Tagged | 32 Comments

RIGHT() function in SQL Server

SQL Server – RIGHT () function Right():- This function returns the specified number of characters from the Right part of the given character string. Syntax:- Select RIGHT ( character_expression , integer_expression ) For example, the below query will return two characters … Continue reading

Posted in SQL Basic, SQL Functions, SQL Server | Tagged | 30 Comments

LEFT() function in SQL Server

LEFT() function in SQL Server Left() Function  This function returns the specified number of characters from the left part of the given character string. Syntax Select LEFT ( character_expression , integer_expression )For example, the below query will return two characters … Continue reading

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

Between function in SQL Server

Between function in SQL Server This function is used to select the values within a specified range. These values can be of Int type or Date data type or Text data type. Syntax:- SELECT column_name(s) FROM table_name WHERE column_name BETWEEN … Continue reading

Posted in SQL Basic, SQL Functions, SQL Server | Tagged | Leave a comment

SQL Script to find the missing indexes

Script to find the missing indexes Performance tuning in SQL is important exercise and index creation is an important part of it. Sometimes base on the frequent SQL queries, we need to create some indexes or missing indexes which are enhance the … Continue reading

Posted in DBA, SQL Advanced, SQL Indexes, SQL Server | Tagged , | 29 Comments

SQL SERVER – Data types

Data types in SQL Server In relational database, we store data in tabular form where data is divided into columns. Each column has a name and a data type which shows what type of data is going to store in … Continue reading

Posted in SQL Basic, SQL Data Types, SQL Server | Tagged | 32 Comments