Sunday 31 January 2016

SQL Inner Join

No doubt that one of the most common programming questions of all time is What are SQL joins?  and what so ever. 
In this article i will try my very best to explain what a SQL inner join is. Basically an inner SQL join is used to combine all rows of  two tables where the condition is met.



The common syntax of an inner SQL join is as below

SELECT column_name(s)
FROM table1INNER JOIN table2ON table1.column_name=table2.column_name;


So guys the very first thing is that lets suppose we have two tables. Table 1 is ORDERS and Table 2 is CUSTOMERS  Both of the tables are given below.


A section from CUSTOMERS table is

 A section from ORDERS table is


Now if we observe both tables closely we can see that there is a connection between the two the "CustomerID" in the CUSTOMERS(Primary key)  table is acting as a Foreign Key in the ORDERS table. Now to begin with query of joins on these tables we should write as

SELECT Customers.CustomerName, Orders.OrderID
FROM CustomersINNER JOIN OrdersON Customers.CustomerID=Orders.CustomerID;


The result would be all the rows meeting the condition as shown below:



Remember a join always return the data "rows" and not the "columns" this is the mistake most guys make and expect the same number of columns.

I hope you like the article and its of use to you dont forget to share your views as i will highly appreciate them Thanks!.


Saturday 30 January 2016

How to install VMware tools in Linux (Ubuntu Gnome 15 Wiley Werewolf)

This article is for installing tools in any linux distribution.


After installing Ubuntu guest OS in VMware Workstation, login to Ubuntu guest machine and update the systems. It’s better to update the systems prior to installing the guest tool. It’s not required to update Ubuntu first, but it makes things easier when installing the tool.



Ubuntu Update

To update Ubuntu, run the commands below

"sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove"

Restart the guest machine.

Installing Tools

1.       First go to the VMware panel at the top click “VM” and then again click “Install VMware tools”.
2.       After this is done go to the computer folder and above that you will see the VMware tools as shown below


As I have already installed the tools I am getting this option you will get the one mentioned above.
1.       Extract the tools in the tmp directory
2.       Open a terminal Window by pressing CTRL + ALT + T
3.       Access the target directory
Cd  /tmp/vmware-tools-distrib
4.       Execute installation Script
./vmware-install.pl
5.       Choose all the default Settings

6.       Restart the system and you are ready to go J