Sunday, April 22, 2012

SQL ( Structured Query Language ) Crash Course


Types of SQL :

  1. DDL ( Data Definition Language )
  2. DML ( Data Manipulation Language )
  3. DQL ( Data Query Language )
  4. DCL ( Data Contorl Language )
  5. DTCL 
Syntax to create table :

create table <table_name> ( <column_name1> datatype1(size), <column_name2> datatype2(size), <column_name3> datatype3(size) );
eg : create table emp empno(5);
      create table emp empno(7,2);  // here size is 7 digits and limitation is 2 digits after decimal point.

Note :  All Query Statements must end with a semi-colon ( ;) .
         :  These Queries are to be written in the sql command lines....
         : SQL queries are not Case-sensitive but the table data are Case-sensitive . 

Creating table with constraints :

Constraints : A restriction applied to a table or accepting value 
eg : primary key, foreign key, unique, not null, check.

Primary key : A Table can have only once primary key.
Unique : A column cannot contain duplicate value.
Not Null : A column cannot contain a null value ( no-value)
Check : The Column will only contain values with a range.

eg : create table emp (empno number(5), empname varchar (20), sal number (7,2), check (sal>0));

Primary key : This is a value of a column or columns present in a table to recognize each of its record uniquely.
A Table can have only one primary key
A Primary key can be column level or table level.
A primary key has to be unique and not null.

Creating table with column level primary key :
syntax :
create table table_name ( column_name datatype(size) primary key, ....... );

Creating table with table level primary key :
syntax :
create table table_name ( column_name datatype (size), column_name datatype (size), ....... , constraint key_name primary key (column_name(s)));

eg :
create table emp (empno number(5), ename varchar (20),sal number (7,3), constraint  k123 primary key (empno,empname));

Foreign Key :
This is the value of a column or columns to refer value of primary key column present in another table.
This can be duplicate.
This cannot contain those value which are not present in primary key column.
A table containing primary key can be dropped only after dropping the table containing its foreign key.
This can be column level or Table level.

Creating table with foreign key at column level :
syntax:
create table table_name ( column_name datatype (size), column_name datatype (size) references primary key table_name (primary key column_name(s).....));
eg :
create table library (empno number(5) references emp (empno),bname varchar(20));

Creating table with Table level foreign key :
syntax :
create table table_name (column_name datatype(size), column_name datatype(size) ........, constarint key_name foriegn key ((column_name(s)) refrences primary key table_name (primary key column (s)));

To Remove a table :
drop table table_name;
ex :
drop table emp;

To Add a column in a Table :
alter table table_name add column_name datatype (size);

To Insert Record in a Table :
insert into table_name values (value1, value2, ....... );

To Insert Values for same columns of table or to insert values without using the order of column present in the table :
insert into table_name (column_name(s) values (value1, value2,...... ));

To insert for same column of table or to insert value without using the order of column present in the table
syntax :
insert into table_name (column_name(s) values (value1, value2,.....);

To Update a Record :
To change values of all Records
syntax :
update table_name set column_name =value ;

To change some record values :
update table name set column_name =value where [condition_provided] ;

To remove record
To rename all record
delete from table_name where [condition_provided] ;

Syntax to fetch records :
select * / column_name(s) / destination column_name [as_alias] form table_name [ where condition ] / group by column_name ] / order by column_name asc/des ] ;

Ex :
1. select * from table_name ;
2. To fetch some column of tables
    select  empno, ename, form emp ;
3. using 'as' to give new name in display
   select empno as no, ename as name form emp;
4. to fetch unique values from a column/ destination
   select distinc set from emp ;

Using condition to fetch records

Operator 
   <, >, <=, >=, !=, =

Using like :
 This can be used to find an expression in text type of column

Symbol 
' _ ' ( underscore ) It can replace one char
' % ' It can replace multiple character

Ex :
 To fetch those records where the value of ename contains 'a' as the first character .
 select * from emp where ename like ' A% ';

AND :
it can be used for multiple condition if all  the condition match then the records get fetched

ex :
select * from emp where empno > 100 and sal > 1000 ;

OR :
It can be used for multiple condition if any of the conditions matched the records get fetched .
ex :
select * from emp where job = " manager " or sal >2000 ;

IN :
This can be used to compare one column with multiple values .
This is the replacement of multiple or the compare values of one column.
ex :
select * form emp where job IN ( 'clerk', 'peon' , 'analyst' );

Some other Formatting :
Single values functions :
sin()
cos()
tan()
round()
floor()
ceil()

Group rule functions :
max()
min()
arg()
count()

Using group by :
This can be used to form groups by using duplicate values of a column.
This is used to perform group value operating column.
ex :
To find arg salary of each job present in emp table
select job avg(sal) as sal any form emp group by job ;

Using order by :
this can be used to arrange records based upon value of a column
Default order is ascending
ex :
select * form emp order by sal ;

NOTE :
This is not the end but just the basics.. all topics covered are not explained completely .. its just an overview of sql queries ....












Friday, April 20, 2012

Basic Software requirements for Newbie Java Programmers

  • Newbie : Any new participant in some activity.
  • Java : Programming language.
  • Software :(computing) written programs, procedures or rules and associated documentation pertaining to the operation of a computer system and that are stored in read/write memory

What is Java?

Java is:
  • Object Oriented
  • Platform independent:
  • Simple
  • Secure
  • Architectural- neutral
  • Portable
  • Robust
  • Multi-threaded
  • Interpreted
  • High Performance
  • Distributed
  • Dynamic    .. Programming Language.

Java Environment Setup:

Java SE is freely available from the link Download Java. So you download a version based on your operating system.
You can refere to installation guide for a complete detail.

JavaTM Platform, Standard Edition Development Kit (JDKTM)
You need to accept the licence agreements before downloading the JDK.
You must accept the OTN License Agreement to download this software.

link :

  • Operating System :
Java is a platform-independent programming language but JVM (Java Virtual Machine) 
Any Operating system will do but Windows is user friendly and Programmers prefer Linux OS.


  • IDE :: Integrated development environment
Also known as integrated design environment or integrated debugging environment is a software application that provides comprehensive facilities to computer programmers for software development.
It consist of 
* Source code editor
* Compiler and/or interpreter
* Build automation tools
* Debugger

**Though using eclipse and Netbeans will affect your basics as it prompts for help and suggestions .. sometimes you will correct the errors and you won't even know what you have corrected ...

Some Examples :
Netbeans IDE
Eclipse IDE

links :

  • Server :
Need to run Java servlets and JSPs in the @localhost and also in remote servers .
Example:
Apache, otherwise known as Apache HTTP Server, is an 
established standard in the online distribution of website services, which gave 
the initial boost for the expansion of the World Wide Web. It is an open-source 
web server platform, which guarantees the online availability of the majority of 
the websites active today.

These servers are also available in Netbeans IDE check the checkbox while installing Netbeans.
Link :

  • Database :
There are generally four types of Databases available.
Database are required to make tables and data added in them .
We can store or retrieve data from the tables.. using Query languages in java program

 Examples :
Oracle 11g,  MS Access, MySQL.











Links :

Microsoft Access Database Engine 2010 Re-distributable
http://www.microsoft.com/download/en/details.aspx?id=13255



Download MySQL Installer
Required :
Windows Installer

Oracle Database Software Downloads

  • Something XTRA :

Note Pad++ a good editor for writing programs.


link:
http://download.tuxfamily.org/notepadplus/6.1.1/npp.6.1.1.Installer.exe











Wednesday, April 18, 2012

Why Google Search is the Best ::

  1. Google's search-results pages is based, in part, on a priority rank called a "PageRank".
  2. Provides many options for customized search, using Boolean operators.
  3. Google Search provides at least 22 special features beyond the original word-search capability.
  • weather
  • stock quotes
  • time
  • sports scoresunit conversion 
  • currency conversion
  • calculator 
  • dictionary look-up
  • maps 
  • movie show-times
  •  travel data/airports
  • area code
  • synonym search etc ...
  1. Special features for numbers, including ranges (70..73),prices, temperatures, money/unit conversions , calculations (5*2/4), package tracking, patents, area codes, and language translation of displayed pages.
  2. Google introduced "Google Voice Search" and "Search by Image" features for allowing the users to search words by speaking and by giving images.
  3. Google's homepage includes a button labeled "I'm Feeling Lucky". When a user types in a search and clicks on the button the user will be taken directly to the first search result, bypassing the search engine results page.
  4. On certain occasions, the logo on Google's webpage will change to a special version, known as a "Google Doodle". Clicking on the Doodle links to a string of Google search results about the topic.
  5. In addition to its tool for searching webpages, Google also provides services for searching images, Usenet newsgroups, news websites, videos, searching by locality, maps, and items for sale online.
Source : en.Wikipedia.org


The softwares i prefer for my PC part 1




Windows 7 is a version of Microsoft Windows, a series of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptops, netbooks, tablet PCs, and media center PCs.Windows 7 was released to manufacturing on July 22, 2009, and reached general retail availability on October 22, 2009, less than three years after the release of its predecessor, Windows Vista. Windows 7's server counterpart, Windows Server 2008 R2, was released at the same time. Windows 7 will be succeeded by Windows 8, which has no release date as of yet.
It is a very-easy to use operating system ,with it high-resolution support.It does not require Driver softwares It automatically installs all driver software relieving of your tenshion that some of your hardware is not working. I am not a personal critic but i can say from my personal experience it is the best OS.

"It plays everything!"

The media player that fills all your needs. It can handle DVDs, (S)VCDs, Audio CDs, web streams, TV cards and much more.
You don't need to keep track of a dozen codec packs you need to have installed. VLC has all codecs built-in. It comes with support for nearly all codec there is.
And what is more it can even play back the file or media if it is damaged! Missing or broken pieces are no stop to VLC, it plays all the video and audio information that's still intact.
Winamp is a media player for Windows-based PCs, written by Nullsoft, now a subsidiary of AOL. It is proprietary freeware/shareware, multi-format, extensible with plug-ins and skins, and is noted for its graphical sound visualization, playlist, and media library features. Winamp was released by Justin Frankel in 1997, and its popularity grew quickly, along with the developing trend of MP3 file-sharing.
Easy to use,easy drag and drop music files and folders, easy to create playlist.. An overall EASY-TO-USE-AUDIO-PLAYER.

µTorrent (or uTorrent and commonly abbreviated as "µT" or "uT") is a freeware, closed source BitTorrent client by BitTorrent, Inc. It is available for Microsoft Windows and Mac OS X. Both versions are written in C++. It gets the "µ" in its name from the SI prefix "micro" meaning one one-millionth and it refers to the program's small footprint by using the UPX executable compressor. The program is designed to use minimal computer resources while offering functionality comparable to larger BitTorrent clients such as Vuze or BitComet.
The program has received consistently good reviews for its feature set, performance, stability, and support for older hardware and versions of Windows. A report showed that µTorrent is the second most popular BitTorrent client (after the Chinese Xunlei).
The program has been in active development since its first release in 2005. Although originally developed by Ludvig Strigeus, since December 7, 2006 the code is owned and maintained by BitTorrent, Inc. The code has also been employed by BitTorrent, Inc. as the basis for version 6.0 of the BitTorrent client, a re-branded version of µTorrent.
A small size bit torrent client, fast, easy to use and green...
UltraSurf is a free software which enables users inside countries with heavy Internet censorship to visit any public web sites in the world safely and freely. Users in countries without internet censorship also use it to protect their internet privacy and security.

With UltraSurf started, you can use web browsers (like IE, Firefox) the same as before, but all are under UltraSurf's protection now.
 It's a small, green software. No installation needed. You need to unzip the file if you download the zip version. Double-click the UltraSurf executable file to start UltraSurf program.
CC cleaner(Optimization and Cleaning)
CCleaner is the number-one tool for cleaning your Windows PC. It protects your privacy online and makes your computer faster and more secure. Easy to use and a small, fast download.
Leave no trace behind, surf adult site, open illegal files.. all the history all the traces cleaned in just one click, want to arrange you start-up program-mes  then this is the solution for you..... also repair your registry damages ..
 Auslogics Disk Defrag is a compact and fast defragmenter that supports both FAT 16/32, and NTFS file systems. It is supplied with advanced optimization techniques, which will remedy your system sluggishness and crashes caused by files fragmentation.


"Plays DVD, DivX everything I have tried to date."
Pros: Minimal system footprint. A lot of options and settings and "No Installation", just unzip it adjust your settings and go. Nice little player. I have gotten rid of InterActual Player and others. It is and will probably stay my default video player.
Cons: Haven't really found anything I don't like so far. Small learning curve and works great! Gave it 4 stars because nothing is perfect.
Not the most comfortable player but it plays every format that is associated with video streaming.......

Tuesday, April 17, 2012

Chat With Command Prompt using Receiver's IP Address


If you want a private chat with a friend or client on you Network, you don't need to download any fancy program!
All you need is your friends IP address and Command Prompt.

Firstly, open Notepad and enter:

@echo off
:A 
Cls
echo MESSENGER 
set /p n=User: 
set /p m=Message: 
net send %n% %m% 
Pause
Goto A 




Now save this as "Messenger.bat". Open the .bat file and in Command Prompt you should see:
MESSENGER
User:

After "User" type the IP address of the computer you want to contact.

After this, you should see this:
Message:

Now type in the message you wish to send.
Before you press "Enter" it should look like this:
MESSENGER
User: 192.168.11.21
Message: Wassup ?

Now all you need to do is press "Enter", and start chatting!
For Next message u need to again enter the receiver's IP Address.