Sunday, November 10, 2013

Database- SQL


Your browser does not support the HTML5 canvas tag.

  • SQL stands for structured Query Language. 
  • SQL is an ANSI  (i.e. American National Standards Institute  ) standard computer language for accessing and manipulating database systems.
  • SQl statements are used to retrieve and update data in a database.
  • SQL works with database programs like MS Access ,DB2,Informix ,MS SQL Server, Oracle ,Sybase,etc.
  • The first version ,initially called SEQUEL,was designed to manipulate and retrieve data 
  • SQL is a Non - procedural query language.
  • Sometimes referred to as a Database Gateway Language as an ANSI made it a standard language for all DBMS.

SQL commands are divided into following categories:-
1)Data Definition Language-
                   It uses create,alter,drop,truncate
2)Data Manipulation Language -
                   It uses insert ,update,delete
3)Data Query Language -
                   It uses select
4)Data Control Language
                   It uses grant ,revoke
5)Transaction control Language
                   It uses commit,rollback
Syntax:
Create-  CREATE TABLE tablename(columnname1 data_type (size)[constraints],(columname2 data_type (size)[constraints],....)

Alter- ALTER TABLE tableman ADD(<columnname> data_declaration[constraints],<columnname> data_declaration[constraints],.....);

 To delete  Drop - DROP TABLE <tablename>[CASCADE CONSTRAINTS];

Truncate Table<tablename>;
removes all rows from a table and is high speed data deletion statement.


Click here for solve the quiz on sql


Saturday, November 2, 2013

Mathematics

Enter any number in the below text box and get the multiplication table of that number after clicking on the button next to it.


MULTIPLICATION TABLES


Do addition of any two numbers by entering the numbers below:
ADDITION +


Do subtraction of any two numbers by entering the numbers below:
SUBTRACTION -


Do division of any two numbers by entering the numbers below:
DIVISION /


Do multiplication of any two numbers by entering the numbers below:
MULTIPLICATION *



NumberPrefixSymbol
10 1deka-da
10 2hecto-h
10 3kilo-k
10 6mega-M
10 9giga-G
10 12tera-T
10 15peta-P
10 18exa-E
10 21zeta-Z
10 24yotta-Y
NumberPrefixSymbol
10-1hecto-h
10-2kilo-k
10-3 mega-M
10-6giga-G
10-9tera-T
10-12peta-P
10-15exa-E
10-18zeta-Z
10-21yotta-Y
10-24yocto-Y


Your browser does not support the HTML5 canvas tag.




Algebraic equation :

x2 - y2 =(x+y)(x-y)
(x+y)2 = x2 + 2xy + y
(x-y) 2 = x2 - 2xy + y2

Sunday, October 27, 2013

Cryptography and Security

Your browser does not support the HTML5 canvas tag. Cryptography is the art and science of achieving security by encoding messages to make them non-readable.

Cryptanalysis is the technique of decoding messages from a non-readable format back to readable format without knowing how they were initially converted from readable format to non-readable format.
Cryptology is a combination of cryptography and cryptanalysis.

Principles of Security:-
1)Confidentiality
2)Integrity
3)Authentication
4)Access control
5)Availability
6)Non-repudiation
7)Ethical and legal issues

Types of attacks:-
1)General attacks-Criminal attacks,publicity attacks,legal attacks
2)Technical view-a)Theoretical concepts-
I)Passive attacks-i)release of message contents ii)traffic analysis
II)Active attacks-i)Interception,ii)Fabrication,iii)Modification,iv)Interruption
3)Program attack-
a)Virus- A virus is a computer program that attaches itself to another legitimate program and causes damage to the computer system or to the network.
During lifetime ,a virus goes through four phases:-
Dormant phase,Propagation phase,Triggering phase ,Execution phase.
b)Worm
A worm does not perform any destructive actions and instead ,only consumes system resources to bring it down.
c)Trojan Horse
It allows an attacker to obtain some confidential information about a computer or a network.
d)Specific attacks-
Sniffing and spoofing-cause packet level attacks.
Phishing-It is new attack which attempts to fool legitimate users to provide their confidential information to fake sites
Pharming  /DNS spoofing -attack involves changing the DNS entries so that users are redirected to an invalid site,while they thinking that they have connected to the right site.

Monday, August 26, 2013

Logic Gates

The logic gates have one or many input and only one output.The gates used to form integrated circuits (IC's) for digital circuit with combination and sequential of gates.this gates are of mainly 6 types .The three are basic gates and others are the prepared from basic gates called as derived gates.They are as follow:-
I ) Basic gates :-
                               i ) OR gate
                               ii) AND gate
                               iii)NOT gate
II) Derived gates :-
                              i ) NOR gate
                              ii) NAND gate
                              iii)EX-OR gate
The Logic gates have the following details:
1)Logic:-It is the statement.
2)Truth table:-It shows the input provided and output get.It is combination of input provided  making rows in the table with inputs and output column.
3)Boolean equation :-It is the mathematical representation with the equation.
4)Symbol:-It is the logical symbol of the logic gate.

1) OR gate

    Logic :- If A is true or B is true  then Y is true

    Boolean Equation :- Y=A+B

   Truth table:

A B Y
0 0 0
0 1 1
1 0 1
1 1 1

Symbol:-

2) AND gate

    Logic :- If A is true and B is true  then Y is true

    Boolean Equation :- Y=A.B or Y=AB

   Truth table:

A B Y
0 0 0
0 1 0
1 0 0
1 1 1

Symbol:-
 
3) NOT gate

    Logic :- If A is true then Y is false and A is false  then Y is true

    Boolean Equation :- Y=A.B or Y=AB

   Truth table:

A Y
0 1
1 0

Symbol :-
4) NAND gate
   Truth table:

A B Y
0 0 1
0 1 1
1 0 1
1 1 0


Boolean Equation :- Y=A.B 
 
Symbol:-
5) NOR gate
Boolean Equation :- Y=A+B
Truth table:

A B Y
0 0 1
0 1 0
1 0 0
1 1 0

Symbol :-

6)EX-OR gate:
Y=A.B+A.B
Logic :When A is true or Bis true but not both then Y is true.
Truth table:

A B Y
0 0 0
0 1 1
1 0 1
1 1 0

Symbol :-


De Morgan's  Law :-
First law :-
Statement:-The compliment of sum is equal to product of compliments.
OR
                   The NOR gate is equivalent to bubbled NAND gate.
 Boolean Equation :-  A+B  = A.B
Second Law :-
Statement:-The compliment of product is equal to sum of compliments.
OR
                   The NAND gate is equivalent to bubbled OR gate.
 Boolean Equation :-  A.B  = A+



 Half Adder:-
For addition of two bits half adder is used .
Truth table:

A B CarrySUM
0 0 00
0 1 01
1 0 01
1 1 1 0

 From the above table we can conclude that gates used in half adder are AND gate for carry and EX-OR gate for Sum.



Monday, August 5, 2013

Number System

Number System
The number system of a number is determined by the Radix of a number.Radix means the base of the number which is obtained by the number of symbols present in that number System.They are as follow:-
 
Sr.No.Number SystemRadixSymbols
1.Binary number System20,1
2.Octal Number System80,1,2,3,4,5,6,7
3.Decimal Number System100,1,2,3,4,5,6,7,8,9
4.Hexadecimal Number System 160,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

1.Binary Number System:- The number System with Radix 2 are said to be binary numbers.It contains only 2 symbols 0 and 1.For Examples (1110)2,(1001)2,(1101)2,(1010)2,(1010.111)2,etc.
2.Octal Number System:- The number System with Radix 8 are said to be octal numbers.It contains 8 symbols 0,1,2,3,4,5,6 and 7.For Examples (257)2,(346)8,(412)8,(728)8,(72.39)8,etc.
3.Decimal Number System:- The number System with Radix 10 are said to be decimal numbers.It contains 10 symbols 0,1,2,3,4,5,6,7,8 and 9.For Examples (123)10,(786)10,(157)10,(928)10,(28.625)10,etc.
4.Hexadecimal Number System:- The number System with Radix 16 are said to be hexadecimal numbers.It contains only 16 symbols 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F.Here A represent for number 10,B represents for number 11,C represents for number 12,D represents for number 13,E represents for number 14,F represents for number 15,For Examples (1ABC)16,(25DE)16,(85C.3D)16,(0AB)16,etc.
Note that for hexadecimal number should start with symbols of numbers only that is 0,1,2,3,4,5,6,7,8,9 and not with A,B,C,D,E,F .If there is a possibility of number to star with alphabets then write 0(zero before that number example (0AB)16,(0ADE)16,etc.

Conversion of numbers Systems:
# Convert Binary to Decimal:- To convert the binary number into decimal we have to multiply each binary number with 2 and then take the raise to power from Least Significant Bit (LSB) side starting with 0 and so on.
1.(1010)2   = 1*23 + 0*22+ 1*21 + 0*20
                  = 1*8 + 0*4 +1*2 + 0*1
                  = 8 + 0 + 2 + 0
                  =(10)10
2.(101)2    = 1*22 + 0*21 + 1*20
                 = 1*4 + 0*2 + 1*1
                 =  4 + 0 +1
                 = (5)10
3.(1001)2   = 1*23 + 0*22+ 0*21 + 1*20
                  = 1*8 + 0*4 +0*2 + 1*1
                  = 8 + 0 + 0 +1
                  =(9)10
4..(1111)2   = 1*23 + 1*22+ 1*21 + 1*20
                  = 1*8 + 1*4 +1*2 + 1*1
                  = 8 + 4 + 2 +1
                  =(15)10
But for fractional numbers that is for the numbers with decimal point we have to multiply fractional numbers with 2 raise to power of -1 from decimal point.
1. (1111.101) =1*23 + 1*22+ 1*21 + 1*20 + 1*2-1+ 0*2-2 + 1*2-3
                      = 1*8 + 1*4 + 1*2 + 1*1+ 1*1/21+ 0*1/22 + 1*1/22
                      = 1*8 + 1*4 + 1*2 + 1*1+ 1*1/2 + 0*1/4 + 1*1/8
                      = 1*8 + 1*4 +1*2 + 1*1+1*0.5 + 0*0.25 + 1*0.125
                      = 8 + 4 + 2 + 1 + 0.5 + 0 + 0.125
                      =(15.625)10
# Convert Decimal to Binary :- To convert the decimal number to binary divide the number by 2 to get integers note down the remainders in front of them simultaneously and then write remainders in reverse order from bottom to top.
  1.(157)10
Solution : -
2157Remainders
2781
2390
2191
291
241
220
211

01
Answer=(11011101)2

2.(9)10
Solution : -
29Remainders
241
220
210

01
Answer=(1001)2
Note:Binary counting can be done by taking only those values of numbers from similarly like starting from decimal numbers only those numbers which contains symbols 0 and 1.That is 0,1,2,3,4,5,6,7,8,9,10,11,12,13,............,99,100,101,102,103,....,110,111,...and so on.Cancel the numbers that contains symbols other than 0 and 1.So the counting will be:
Decimal NumbersBinary numbersHexadecimal Numbers
000
111
2102
3113
41004
51015
61106
71117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F

# Convert octal to decimal:- To convert the octal number into decimal we have to multiply each octal  number with 8 and then take the raise to power from Least Significant Bit (LSB) side starting with 0 for integers and so on.

1. (157)8 = 1*82 + 5*81 + 7*80
              = 1*64 + 5*40 + 7*1
              = 64 + 200 +7
              = (271)10
2.(459)8 = 4*82 + 5* 81 + 9*80
              = 4*64+5*8+9*1
              =256 + 40 +9
              =(305)10
 But for fractional numbers that is for the numbers with decimal point we have to multiply fractional numbers with 8 raise to power of -1 from decimal point and so on -2,-3,.. .
 1.(351.123)8   =  3*82 + 5*81 + 1*80 + 1*8-1 + 2*8-2 + 3*8-3
                        =  3*64 + 5*8 + 1*1 + 1*1/81 + 2*1/82 + 3*1/83
                        =3*64 + 5*8 + 1*1 + 1*1/8 + 2* 1/64 + 3* 1/512
                        =192 + 40 + 1 + 1*0.125 + 2*0.015625 + 3* 0.001953125
                        = 192 + 40 + 1 + 0.125 + 0.03125 +  0.005859375
                        = (233.162109375)10
# Convert decimal to octal:- To convert the decimal number to octal divide the number by 8 to get integers note down the remainders in front of them simultaneously and then write remainders in reverse order from bottom to top.
1.(157)10
Solution : -
8157Remainders
8195
823

02
Answer=(532)8

1.(304)10
Solution : -
8304Remainders
8380
846

04
Answer=(064)8

Saturday, July 20, 2013

Visual Basic Examples


Program 1:- To create Visual Basic application to find the area of rectangle.


Code:-
 Private Sub Command1_Click() Text3.Text = Text1.Text * Text2.Text End Sub

Private Sub Command2_Click()

Text1.Text = " " Text2.Text = " " Text3.Text = " " End Sub


/*************************Output**************************/





Program 2:- To create Visual Basic application to average of 3 numbers.
Design Window:-

Code:-

Private Sub Command1_Click()

Text4.Text = Str((Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)) / 3)

End Sub

Private Sub Command2_Click()

Text1.Text = " "

Text2.Text = " "

Text3.Text = " "

Text4.Text = " "

End Sub

Private Sub Command3_Click()

Unload Me

End Sub


/*************************Output**************************/



Program 3: To create Visual Basic application to illustrate Date-Time functions.

Code:-

Private Sub Command1_Click ()

Text1.Text = Date

Text2.Text = Time ()

Text3.Text = Year (Date)

Text4.Text = Month (Date)

End Sub

/*************************Output**************************/



Program 4:-To create Visual Basic application program to find maximum number among two numbers.

Code:-

Private Sub Command1_Click ()

Dim a As Integer

Dim b As Integer

a = Val(Text1.Text)

b = Val(Text2.Text)

If (a > b) Then

        Label3.Caption = "a is maximum number"

Else

        Label3.Caption = "b is maximum number"

End If

End Sub


/*************************Output**************************/

Program 5:-To create Visual Basic application program to perform arithmetic operations with the use of Option button.

Code:

Private Sub Option1_Click ()

Text3.Text = Val (Text1.Text) + Val (Text2.Text)

End Sub

Private Sub Option2_Click ()

Text3.Text = Val (Text1.Text) - Val (Text2.Text)

End Sub

Private Sub Option3_Click ()

Text3.Text = Val (Text1.Text) * Val (Text2.Text)

End Sub

Private Sub Option4_Click ()

Text3.Text = Val (Text1.Text) / Val (Text2.Text)

End Sub


/*************************Output**************************/



List of bank names in India

 Here is a comprehensive list of banks in India, categorized by type: