"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

June 26, 2013

TSQL Learning

This post is based on very good reading from Article T-SQL Misconceptions - JOIN ON vs. WHERE. These are new learning's for me


1. For Readability - Refrain from using search arguments in the ON clause, and use the WHERE clause instead
2. When Outer Join is Converted to Inner Join - Adding references to the table in the right side of a JOIN to the WHERE clause will convert the OUTER JOIN to an INNER JOIN. I'm trying out Example Code to reproduce the scenario. This Shows the behavior when Left Join in Query is Converted to Inner Join during Execution.


Step 1 - Create Tables

CREATE TABLE Table1(Col1 INT IDENTITY(1,1) PRIMARY KEY, Col2 VARCHAR(40), Col3 VARCHAR(50))

CREATE TABLE Table2(Col1 INT IDENTITY(1,1) PRIMARY KEY, Col2 VARCHAR(40), Col3 VARCHAR(50))


Step 2 - Populate Data

DECLARE @J INT
 SET @J = 1
 WHILE 1 = 1
 BEGIN
 IF @J < 1000
     INSERT INTO Table1(Col2, Col3)
     VALUES((CONVERT(VARCHAR(20),@J)+'VALUE'), (CONVERT(VARCHAR(20),@J)+'VALUE'))
     INSERT INTO Table2(Col2, Col3)
     VALUES((CONVERT(VARCHAR(20),@J)+'VALUE'), (CONVERT(VARCHAR(20),@J)+'VALUE'))
     SET @J = @J + 1
     IF @J > 1000
     BREAK;
 END


Step 3 - Run Queries

SELECT
 N1.Col1, N2.Col2
 FROM Table1 N1
 LEFT JOIN Table2 N2
 ON N1.Col1 = N2.Col1
 WHERE N2.Col1 = 100
 

SELECT
 N1.Col1, N2.Col2
 FROM Table1 N1
 LEFT JOIN Table2 N2
 ON N1.Col1 = N2.Col1
 WHERE N1.Col1 = 120


Step 4 - Execution Plan


Happy Learning!!!

June 21, 2013

Big Data Updates

Interesting Big Data Updates


[Good Read] - Big Data Analysis Takes a Big Bite Out of HPC Workloads: IDC
Summary - High Performance Servers used to run / benchmark big data workloads

[Learning Resource] - Hadoop 101: Programming MapReduce with Native Libraries

[Good Read] - Big Data Transforming Traditional DW Ecosystem - Why Hadoop and Solr in DataStax Enterprise?

Summary 
  • NOSQL feasible alternative competing OLTP Space
  • Big Data Replacing OLAP Ecosystem
Happy Reading!!!

MYSQL Exercises

Couple of learning exercises while working on MYSQL. Earlier MYSQL post please refer link
Learning #1 - Load data from flat file
Created a Temp table, Loaded bulk data using command - LOAD DATA LOCAL INFILE

CREATE TABLE TestTable2 ( A INT NOT NULL, B INT NOT NULL, C INT NOT NULL, D INT NOT NULL );

Dataset looks as below



LOAD DATA LOCAL INFILE 'E:\\DataUpload50K.txt' INTO TABLE TestTable2 FIELDS TERMINATED BY ','  LINES TERMINATED BY '\n';

Reference - link1 , link2
Learning #2 - Enable Remote Access to MYSQL

Execute the Grant All Privileges command by specifying username, IP Address of remote host and password to logon
GRANT ALL PRIVILEGES ON *.* TO 'username'@'XX.XX.XX.XX' IDENTIFIED BY 'pwd';
Encountered error codes 1130, 1045
Reference - link1, link2, link3

Learning #3 - Show System Configuration Settings
Command - SHOW VARIABLES
Reference - link1

Happy Learning!!!

June 19, 2013

heidisql - SQL Interface to MSSQL and MYSQL

This quick post is based on tool shared by my colleague Ambuj. Heidisql - SQL Editor for MSSQL and MYSQL

Step 1 - Pretty simple and quick to install. Downloaded and Installed it from link

Step 2 - You can setup sessions and connect to MSSQL / MYSQL instances. I have used SSMS, Atlantis SQL Explorer. This single interface for both MYSQL and MSSQL is very useful.




Happy TSQL coding !!!

May 15, 2013

TSQL Formatting Tools

Back to blogging after a month long break. Things were quite busy @ work. This post is to focus on TSQL formatters. There are several code formatters that I had come across recently.

1. SQL Formatter for Notepad++ - Download and install Notepad++ plugin from link. Copying the DLL's and checking the Notepad++ Option listed below

Step 1. Copy the DLL's in plugin directory of Notepad++


Step 2. NotePad++ SQL Formatter Options


2. Online SQL Formatter - Link

3. PoorSQL - Online SQL Formatter - Link

4. SSMS Tools pack - SSMS Addons - Link

5. Instant SQL Formatter - Online version - Link

6. Atlantis Interactive SQL Server IDE - Very good IDE for MSSQL - Link

7. SQLInform - SQL Online formatter - Link

Other Free Useful Tools
1. Programmers Notepad
- Link
2. TextPad - Link
3. Notepad++ - Link

Happy Learning!!!

March 17, 2013

Big Data Conference Tech Talks Talks

Please find Tech Talk videos of Interesting Big Data Sessions. Please refer session notes from previous posts

Big Data Analytics @ InMobi



Messaging architecture at Facebook




More Interesting Tech Talk Videos Please check hasgeek TV


Happy Learning!!!

March 09, 2013

SQLite and Java Client


This post is on trying out SQLite and Java Client for querying databases. There were several results returned from google search. The following post Connect Java with SQLite using JDBC Tutorial

Download Links
WIN 32 SQLite - link
sqlite-jdbc.jar - link

Pretty much post was self-explanatory. Posting screenshots of the same project

Step 1 - Running Sqlite ( Pretty easy - console app)


Step 2 - DB and Table Creation


Files Created for Employee



Step 3 - Create a Java Application and add SQLite JAR reference 



Step 4 - Java Project Console Results - Path Changed to Where DB is present



Happy Learning!!!

February 24, 2013

Selenium Builder - Magic Tool for Web Testing

Selenium Builder tool caught my attention from recent selenium post. Selenium IDE is available past few years. It is very useful, robust to get started. The challenging problem for me was fixing XPATH related issues prior to web driver implementation. Selenium Builder seems to remove some of those pain points. In a quick dry run I found below things impressive about Selenium builder.


1. Converting from Selenium 1 to 2
2. Alternatives Suggestions for actions is amazing

3. Run Locally or against Selenium Instance


Earlier we have seen BITE - Browser Integration Test Environment - File Bugs from Browser Level

We Can Simplifying Manual Web Test Process by using
  • Selenium Builder to Records your exploratory tests and replay it for every build
  • Any error encountered File Bugs using BITE
  • Filing bugs is simpler, lot of details attached with bugs filed using BITE and reduces bug logging time
Selenium IDE + Selenium Builder + BITE are powerful set tools for web testers and also right set of tools to get started with automation

Happy Re-Learning!!!