What is the difference between INNER JOIN and OUTER JOIN and LEFT JOIN, RIGHT JOIN, and FULL JOIN fit in?

A SQL join clause combines records from two or more tables in a relational database. It creates a set that can be saved as a table or used as it is. A JOIN is a means for combining fields from two tables (or more) by using values common to each. ANSI-standard SQL specifies five types of JOIN: INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER and CROSS. As a special case, a table (base table, view, or joined table) can JOIN to itself in a self-join.


An inner join will only select records where the joined keys are in both specified tables.

A left outer join will select all records from the first table, and any records in the second table that match the joined keys.

A right outer join will select all records from the second table, and any records in the first table that match the joined keys



Suppose you have two tables, with a single column each, and data as follows:

A    B
-    -
1    3
2    4
3    5
4    6
Note that (1,2) are unique to A, (3,4) are common, and (5,6) are unique to B.

Inner join

An inner join using either of the equivalent queries gives the intersection of the two tables, i.e. the two rows they have in common.

select * from a INNER JOIN b on a.a = b.b;
select a.*,b.*  from a,b where a.a = b.b;

a | b
--+--
3 | 3
4 | 4
Left outer join

A left outer join will give all rows in A, plus any common rows in B.

select * from a LEFT OUTER JOIN b on a.a = b.b;
select a.*,b.*  from a,b where a.a = b.b(+);

a |  b
--+-----
1 | null
2 | null
3 |    3
4 |    4
Right outer join

A right outer join will give all rows in B, plus any common rows in A.

select * from a RIGHT OUTER JOIN b on a.a = b.b;
select a.*,b.*  from a,b where a.a(+) = b.b;

a    |  b
-----+----
3    |  3
4    |  4
null |  5
null |  6
Full outer join

A full outer join will give you the union of A and B, i.e. all the rows in A and all the rows in B. If something in A doesn't have a corresponding datum in B, then the B portion is null, and vice versa.

select * from a FULL OUTER JOIN b on a.a = b.b;

 a   |  b
-----+-----
   1 | null
   2 | null
   3 |    3
   4 |    4
null |    6
null |    5

Source: From all stackoverall

How to add a JDBC driver in Java


This procedure assumes you are creating a new JDBC data source, and you need to install a new driver because the driver that the database requires is not available in the list of drivers.

1  
In New JDBC Data Source Profile, shown in Figure 2-4, choose Manage Drivers.
Figure 2-4 New JDBC Data Source Profile
3  
Navigate to the directory that contains the JAR file. Select the JAR file and choose Open. Manage JDBC Drivers shows the new JAR file.
Figure 2-5 Viewing JDBC driver classes
*
In Driver Display Name, type a user-friendly name that describes the driver. This name appears in parenthesis next to the driver class name in Driver Class on New JDBC Data Source Profile.
*
In URL Template, type the URL format that the driver requires. This URL format appears in Driver URL on New JDBC Data Source Profile.
 shows an example of properties specified for a MySQL JDBC driver.
Figure 2-6 Properties specified for a JDBC driver
Properties specified for a JDBC driver
6  
In New JDBC Data Source Profile, specify the connection properties to connect to the JDBC data source. The Driver Class list displays the installed driver.

Source: Eclipse

How to write inline, internal and external css in HTML

CSS means Cascading Style Sheets, it is used  to decorate and make beautiful for website. There are three different way of CSS used in html or php,

1. Inline - using a style attribute in HTML elements
2. Internal - using a <style> element in the HTML <head> section
3. External - using one or more external CSS files

1. Inline

<!DOCTYPE html>
<html>
<body>

<h1 style="color:blue;">This is a Heading</h1>

</body>
</html>

Output:

This is a Blue Heading

2.Internal 

Internal styling is defined in the <head> section of an HTML page, within a <style> element:

<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: lightgrey;}
h1   {color: red;}
p    {color: gray;}
</style>
</head>
<body>

<h1>This is a main head</h1>
<p>This is a sub head.</p>

</body>
</html>

Output 

This is a Main Head

This is a sub head.

3.External 

External style sheet, you can change the look of an entire web site by changing one file, external style sheet, add a link to it in the <head> section of the HTML page.

Always must used.css extention css file , style.css

body {
    background-color: lightgrey;
}

h1 {
    color: blue;
}

p {
    color:green;
}

And main Html page.

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<h1>This is a Main heading</h1>
<p>This is a sub heading</p>

</body>
</html>

Output:

This is a Main heading

This is a sub heading



How to start programming in Android or Android studio

How to build your first Android app, We are going to simple steps to develop first android project in android.

Set Up Your Environment

Before you start this class, be sure you have your development environment set up. You need to:

  1. Download Android Studio.
  2. Download the latest SDK tools and platforms using the SDK Manager


  • 400 MB hard disk space
  • At least 1 GB for Android SDK, emulator system images, and caches
  • 1280 x 800 minimum screen resolution
  • Java Development Kit (JDK) 7
  • Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality

Mac OS X

  • Mac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
  • 2 GB RAM minimum, 4 GB RAM recommended
  • 400 MB hard disk space
  • At least 1 GB for Android SDK, emulator system images, and caches
  • 1280 x 800 minimum screen resolution
  • Java Runtime Environment (JRE) 6
  • Java Development Kit (JDK) 7
  • Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality
On Mac OS, run Android Studio with Java Runtime Environment (JRE) 6 for optimized font rendering. You can then configure your project to use Java Development Kit (JDK) 6 or JDK 7.

Linux

  • GNOME or KDE desktop
  • GNU C Library (glibc) 2.15 or later
  • 2 GB RAM minimum, 4 GB RAM recommended
  • 400 MB hard disk space
  • At least 1 GB for Android SDK, emulator system images, and caches
  • 1280 x 800 minimum screen resolution
  • Oracle® Java Development Kit (JDK) 7
  • 64-bit distribution capable of running 32-bit applications
Tested on Ubuntu® 14.04, Trusty Tahr (64-bit distribution capable of running 32-bit applications).

Now, Click Android Studio and download gradle, then start new android project

How to write first program in studio

File-> New -> New Project

then follow the Put Name of Project and required other fields. and Click Next.
Last but the least, Run the project.

You will see output the demo project.




Write first java program in Eclipse

Downloading and installation 

 Step 1: 
 Go to http://www.eclipse.org/downloads/

Step 2:
Bascially, all java programmer using Eclipse IDE for Java EE Developers , and choose your appropriate Operating System. or you can use other ide.

Step 3:
you must already have the Java SDK installed. Unzip the file and double-click eclipse.exe.


How to write First Java program 

How do I write a simple "Hello World" program?

To write a "Hello World" program follow these steps:

    Start Eclipse(Inside the unzipped eclipse folder)
 
    Create a new Java Project:
        File->New->Project.
        Select "Java" in the category list.
        Select "Java Project" in the project list. then Click "Next".
        Enter a project name into the Project name field, for example, "FirstJava Project".
        Click "Finish"

 
  Create a new Java class:
         Right click of Project and go to Class then Put name of class. Class name must be start with capital letter
            Click the checkbox indicating that you would like Eclipse to create a "public static void main(String[] args)" method.
        Click "Finish".
 
   A Java editor for HelloWorld.java will open. In the main method enter the following line.
       
   System.out.println("First Java Program");
   
   Save using ctrl-s. This automatically compiles FirstJava .java.

    Click the "Run" button in the toolbar  or Ctrl+F11

    You will be prompted to create a Launch configuration. Select "Java Application"

   Output in  console will open and display "FirstJava ".