Saturday 31 May 2014

Excel Tips (2) with Sanjay Bakshi

Now day’s people are very used to GUI (Graphical User Interface) most of the time they use Mouse but developer still believes writing formulas. As an IT person I also feel writing formula’s rather than going to search options etc.

We will showcase some formula tips which help user to perform their task if they are not aware about options.

Situation 1

You got one file from client and it contains Column A as Employee Name which is a combination of First Name & Last Name. Now your boss has asked you to create a report with First Name only.So challenge is to "Get the first name". There is already one feature available in Excel but we will create a formula for this.



                                           Answer : =LEFT("Cell_No",FIND(" ","Cell_No")-1)

********************************************************************************************************



Situation 2
Count the number of instances where amount is less than 0.


Answer : =COUNTIF(C3:C9,"<0")

********************************************************************************************************

Situation 3
Count the no of days/Month/Year between two dates

There are multiple ways to handle above situation in Excel, we are going perform same task with Datedif function

Calculate Days

Please follow below steps
1) Create one Cell with Start Date
2) Create one Cell with End Date
3) In third Cell add =datedif(start_date,end_date,"D")

Calculate Month

Please follow below steps
1) Create one Cell with Start Date
2) Create one Cell with End Date
3) In third Cell add =datedif(start_date,end_date,"M")

Calculate Year

Please follow below steps
1) Create one Cell with Start Date
2) Create one Cell with End Date
3) In third Cell add =datedif(start_date,end_date,"Y")


********************************************************************************************************

Situation 4
You have created one training plan with start date and end date and training manager has asked, please let me know in how many working days you will cover the training program? If you are not ready with your an answer the below function will definitely save you from trouble.

Please follow below steps to answer above query
1) Enter Training Start Date in First Cell
2) Enter Training End Date in Second Cell
3) Enter =NETWORKDAYS(Training_Start_Date,Training_End_Date)

Training Start Date Training End Date Work Days
1/1/2004 5/31/2014 2717

 
********************************************************************************************************
Situation 5

When you have given the above answer all of sudden Training Manager has tweak the situation and informed "Oh Sorry I Forget Every 1st October we will have holiday) so now tell me how many working days required"

So now as per situation you have to minus all the days for 1stOct.Not to worry NETWORKDAYS is having one parameter where you can define optional holiday range.

Please follow below steps to answer above query
1) Enter Training Start Date in First Cell
2) Enter Training End Date in Second Cell
3) Enter =NETWORKDAYS(Training_Start_Date,Training_End_Date,Optional_Range)

Please do not get confuse that Situation 4 has returned 2717 days and and situation 5 has returned 2710 but holidays are 10

Net work days does not consider Saturday and Sunday.

Start Date End Date Net Work Days
1/1/2004 5/31/2014 2710
Holiday List    
10/1/2004  
10/1/2005
10/1/2006
10/1/2007
10/1/2008
10/1/2009
10/1/2010
10/1/2011
10/1/2012
10/1/2013

Points to Remember

1) First Parameter represents Start Date
2) Second Parameter represents End Date
3) Holidays is an optional parameter or range of one or more dates to exclude from working calendar.

********************************************************************************************************

Keep Learning, Happy Sunday

Sanjay Bakshi
mesanjaybakshi@gmail.com


Thursday 29 May 2014

Functions (SQL)


SQL is having multiple inbuilt functions which help developers to z many complex situations in day to day life.
All the functions are divided in four categories.

1)      Row set Functions

2)      Aggregate Functions

3)      Ranking Functions

4)      Scalar Functions

Row set Functions
 Row set Function return an object that can be used like a table reference in a SQL statement.

Aggregate Functions
These functions operate on a collection of values but return a single and summarize value

Ranking Functions
These functions returns a ranking value for each row in a partition

Scalar Functions
Operate on a single value and return a single value. There are 12 different kinds of Scalar Functions available. We will study all in details and we will see the example also.

 In coming posts we will learn about above functions in detail with Example.
Happy Reading!!!!!!
 
Sanjay Bakshi

Sunday 25 May 2014

Excel Tips (1) with Sanjay Bakshi

Hi Friends,

Today somebody asked me about Pictograph and I thought I should share with you all. 

Sometimes we get tricky situations in Excel which left us with "What to do" voice

Presenting some tips which will be very useful for freshers and professionals. In this post we will cover

1) Date Format
2) Pictograph
3) Play with Comment Box
4) Auto Correct Options

******************************************************
Change Date format

You got one notepad file and you are trying to open in Excel and one of the column surprise you.






******************************************************
This is about Pictograph

1) Create column chart
2) Paste one picture in Excel File
3) Copy that picture
4) Select Series button in Chart
5) And paste (Ctrl + V)
6) And Pictograph is done


******************************************************
Play with Comment Box

There are so many features available in Excel which we normally don't use in our normal life but it is good to know about those features. And one of them is "Add Picture as a Comment Box"

See Below Picture






 Now See Below Picture


Here's how you can do it:

1) When the comment is selected by the border, click the new Change Shape tool.

2) Select the Box and click on Format Comment

3) Select color and Lines Tab

4) Click on Fill Effects

5) Click on Picture Tab

5) Select Picture 

6) Click Ok

******************************************************
Auto-correct Options

We can save a lot of time by entering shortcuts for commonly used

 terms in Excel. e.g Most of the time I use Sanjay Bakshi word in 

Excel and I wanted to create shortcut for this so whenever I will 

type SANJ, automatically Excel will change text to "Sanjay Bakshi".


1) Click on Excel Options

2) Click on Proofing

3) Click on auto correct options

4) Write shortcut word in "Replace" Text Box

5) Write new word in "With" Text Box

6) Click OK








That's all for Today, see you tomorrow with new learning.

Sanjay Bakshi
mesanjaybakshi@gmailcom

(Keep Calm & Keep Learning)




SQL (Master & MSDB Database)

The Server system catalog and all the environmental information stored in Master Database. The master database is the brain of the server. Database administrator has to take special care of Master Database whenever they change any values of master database.Administrator should have the habit of backing up the master database whenever make any changes. The following items should trigger a backup of Master Database.

1) Disk Statements
2) Altering a Transaction Log
3) Adding & Removing Mirror Device
4) Adding & Removing remote servers
5) Adding & Dropping Login Id
6) Any change in server configuration

Tables such as SysLock,Sysdatabase,SysProcess and Sysusage are a part of Master Database. The server will allow user to change the values via Raw SQL of these tables and it is recommended also not to change values.

Other than this Master Database includes Logon Accounts, End Points, Linked Server and System Configuration Settings. Master database store information of all other database also.

Below is the Physical Properties of Master Database


File
Logical name
Physical name
File growth
Primary data
master
master.mdf
Autogrow by 10 percent until the disk is full.
Log
mastlog
mastlog.ldf
Autogrow by 10 percent to a maximum of 2 terabytes.

Below are some basic queries which Database Administrator uses normally

-- To get the Login Count
SELECT COUNT(*) FROM master..syslogins
GO


-- Login Details
SELECT name, createdate  FROM master..syslogins
GO


-- Database Size

SELECT d.name,ROUND(SUM(mf.size) * 8 / 1024, 0) Size_MBs FROM sys.master_files mf INNER JOIN sys.databases d ON d.database_id = mf.database_id WHERE d.database_id > 4 GROUP BY d.name ORDER BY d.name


***********************************************************************************

Msdb database is used by SQL Server Agent to execute Job, Executing Alerts. Sql Server automatically maintain a history of Backup and the devices where backup has been taken.All these events will be stored in Msdb database.Msdb stores multiple useful information so it is recommended that you consider placing the Msdb transaction log on fault tolerant storage.

Below is the Physical Properties of Msdb Database


File
Logical name
Physical name
File growth
Primary data
MSDBData
MSDBData.mdf
Autogrow by 256 KB until the disk is full.
Log
MSDBLog
MSDBLog.ldf
Autogrow by 256 KB to a maximum of 2 terabytes.


**************************************************************************************

For freshers below question is very common in an interview where interviewer is looking for basic of Master Database

Ques : Define Master Database
Ans : Database which store system level information such as user accounts,configuration settings.

Ques : Define Msdb Database
Ans : Database used by the SQL Server Agent for configuring alert and schedule Job

Ques : Can you move system databases?
Ans : Yes We can move the database and moving database will be useful in below circumstances
1) Failure Recovery
2) Planned Relocation
3) Relocation Schedule Disk Maintenance
All above scenario is applicable moving files within same instance. 



This has been a match of epic proportions getting 190 in 14.3 was an improbable ask. 

So there's a will there's a way 

That's all for Today, see you tomorrow with new learning and Mumbai have qualified.

Sanjay Bakshi
mesanjaybakshi@gmailcom
(Keep Calm & Keep Learning)


Thursday 22 May 2014

SQL (History)

History
In 1970 IBM has described a relational model for database and in 1974 Structure Query Language appeared. In 1978 IBM started working and changed the Codd ideas into reality and developed product called “System/R”. IBM developed first prototype of relational database and standardized by ANSI. The first relational database was released by Relational Software and its later became Oracle.
The initial version was SEQUEL (Structured English Query Language).
When we execute an SQL Command for any RDBMS, the systems determine the best way to carry the request and SQL engine figure out how to perform the task. There are many component involved in the process. These components are Query Dispatcher, Optimization Engine, Classic Query Engine and SQL Query Engine.
Following is a simple diagram of showing SQL Architecture



Microsoft SQL Server

Microsoft SQL Server is a relational database management system developed my Microsoft. It is a software product whose primary functions is to store and retrieve data as requested by other applications. Its primary languages are T-SQL and ANSI SQL.

SQL Version History





That's all for Today, see you tomorrow with new learning. Please do send your queries and feedback.

Sanjay Bakshi
mesanjaybakshi@gmailcom
(Keep Calm & Keep Learning)

Wednesday 21 May 2014

What is Azure?

When we read about SQL 2014 several times we have found word “Azure”. In today’s discussion we will discuss about “Azure”.

"Azure" is an open and flexible cloud platform that enables user to quickly build, deploy and manage applications across a global network of Microsoft Managed Data Center and user can integrate their public cloud applications with their existing IT environment.

"Azure" delivers a 99.95% monthly SLA and enables us to build and run highly available applications without focusing on the infrastructure. It provides automatic OS and service patching, built in network load balancing and resiliency of hardware failure. It supports a deployment model that enables user to upgrade their application without any downtime.

"Azure" enables us to use any language, framework, or tool to build applications. Features and services are exposed using REST (Representational State Transfer) protocol. The Azure client libraries are available for multiple programming languages.

"Azure" enables us to scale our applications to any size. It is fully automated self-service platform that allows us to provision the resource within minute.  Azure is available in multiple data center around the world, enabling us to deploy our application close to our customer.

How to Setup Azure
  1. First install the SDK. (You can search – Azure SDK for Visual Studio 2013)
  2. When you are prompted to run or save the installation file. Click on RUN
  3. In the Web platform window click on Install
  4. After above Installation Open Visual Studio 2013
  5. Click on File Menu and Select New Project
  6. Give the name of the project and select  (VB or C#)
  7. Make Sure .Net Framework 4.5 is selected as the target framework
  8. In the new ASP.Net Project dialog box, select MVC or Web Forms and click on Change Authentication
  9. In change Authentication click “No Authentication” box and click OK
  10. Under Azure in the dialog box, leaves the check box selected and the drop down to Web Site and click OK
  11. If you haven’t sign for Azure, Visual Studio 2013 will prompt you to do the same
  12. When you sign In system will prompt for “Configure Windows Azure Settings”, please provide the required details

a.Site Name
b.Region
c.Database Server
  1. 13)  The site name will take the project name so if you have created the project as “MYEXAMPLE6442” system will make the URL MYEXAMPLE6442@azurewebsites.net. If somebody else is using same URL you will get an indications
  2. 14)  In the region you can select the data center which is near to you
  3. 15)  Click OK
In a few seconds Visual Studio will create the web project in the folder you specified with specific region

Write a Code
  1. Create your application with any dummy code/database code
  2. Test your application
  3. Now we are ready for Publish

Publish
  1. In the Web Publish Activity window, click on Publish application to test your site
  2. System will show Publish Web Wizard

a.Provider server name
b.Provide Site Name
c.Provide User Name
d.Provide password
e.Click on Validate Connection (you will get Green Color tick mark on success)


On the successful completion the browser automatically opens the URL of the deployed web site and the application “MYEXAMPLE6442” is running in the Cloud.

I am providing collection of some pictures which will help users to understand the steps

SDK Installation

Creation of Application

Selection of Web Form and Section of Authentication Mode

Change Authentication Process

Azure Setting

Sign in for Azure


Publish Code

Site Launched on CLOUD

That's all for Today, see you tomorrow with new learning. Please do send your queries and feedback.

Sanjay Bakshi
mesanjaybakshi@gmailcom
(Keep Calm & Keep Learning)
I

Monday 19 May 2014

Basics of OLTP (On Line Transaction Processing)

In last blog we have understood the features of SQL 2014 and one of the main feature is "In Memory OLTP". It is advisable to know first what is OLTP and then proceed for "In Memory OLTP"

OLTP is a popular data processing system in today's enterprises. The main usage of OLTP is in Retail / Gaming Industry and Financial Transaction Systems. OLTP requires support for transaction that span a network and may include more than one company. For this reason , the modern OLTP software use client or server processing and brokering software that allow transactions to run on different platform in a network. 

The design of OLTP should follow the discipline of data modelling and should follow the Codd rules of data normalization. Using these rules, complex information is broken down into its most simple structure where all the individual atomic level elements relate to each other and satisfy the rule of normalization.

The industry which have a large numbers of users who conduct short transactions uses OLTP. In OLTP concept database queries are simple but require sub second responses times and return relatively few records.


Objective of OLTP
  • Fast Transactions
  • Maximizing CPU Resource
  • Maximizing IO Resources

Below Attributes are basic attributes which SQL Developer should know about OLTP
  • Holds Current Data
  • Store Detailed Data
  • Enable a snap shot of business data
  • Short and fast Insert/Update
  • Handle large number of short on line transactions
  • Involves standardized and simple queries that return relatively few records hence is faster
OLTP helps simplify a business operation by reducing paper trails and helping draw faster and accurate information.

Today with the ubiquity of the Internet, more and more people are doing on line transactions through e commerce environment. During the process of online transactions a merchant system will automatically connect to the bank or credit card company of the customer and carry out security and other fraud check and make decision of payment. In these kind of transactions it is advisable to have a robust, secure and reliable infrastructure  that gives customer  fast, seamless and secure check point.


Sanjay Bakshi
mesanjaybakshi@gmailcom
(Keep Calm & Keep Learning)


Sunday 18 May 2014

Why SQL Server 2014

Hi All,

Now days there is a Version Trend of almost everything. Sometime people doubt that what is the use of Version? Why there are so many products are launching every days. My son keeps asking me that "Dad, we have purchased Samsung Note 2 and now what is Note 3 and etc". He is 6 yrs old and I can not tell him about version so I told him Version means “Deployment of New features which will make you more efficient".

In the same line I am exploring new version of SQL 2014. The first thing I like about SQL 2014, which enables me to create mission critical applications and big data solutions using high performance memory technology across OLTP (
Online Transaction Processing). It uses a common set of tools to deploy and manage database both in our premises and in the cloud which makes me to take advantage of the cloud with existing skills. 

This helps me to implement hybrid cloud computing environment to easily build and deploy and manage solutions that span on premise and cloud.

The main advantage which I see is 

1) Enable to Handle Critical Performance
2) Faster Insight of Data
3) Set Platform for Hybrid Cloud

In another blogs we will go in detail but as of now I am just defining as an example

Mission Critical Performance
SQL Server enables transaction speed up to 30 xs faster with In Memory OLTP (Online Transaction 
Processing).

Faster Insight of Data
Enhanced BI speeds up the analysis with Excel in office and power BI via Office 365. We can easily create solution from Data Management to BI and Analytic.

Set Platform for Hybrid Cloud
Hybrid cloud makes me enable to keep live data in my premise and backup and disaster recovery on cloud. It is advisable to run SQL Server on Windows Azure to get the benefit of cloud computing faster.

In next session we will understand about OLTP (Online Transaction Processing) in details.

Keep Reading


Sanjay Bakshi
mesanjaybakshi@gmailcom
(Keep Calm & Keep Learning)