Sunday, December 4, 2011

Understanding normal forms

Normal forms or normalization was very hard for me understand until I came across a webpage and everything became quite clear for me. The plus point about this webpage was the way it explained the normal forms. The explanation does not use relational algebra or functional dependencies to understand normal forms.
1st Normal Form:
1st normal Form deals with the shape of a Record Type. 
Under first normal form, all occurrences of 
record type must contain the same number of fields.

First normal form excludes variable repeating fields and groups.

2nd Normal Form:

Second normal form is violated when a non-key field is a fact about a subset of a key.
It is only relevant when the key is composite, i.e., consists of several fields.


Consider the following inventory record:
R(Part, Wherehouse,Qty,Wherehouse-Address)
Here the key is Part-Wherehouse fields together but Wherehouse-Address is fact about Wherehouse only. So it violates the 2nd Normal form.
The decomposition should be:
R1(Part,Wherehouse,Qty)    and      R2( Wherehouse,Wherehouse-Address)
The problems here were:
The warehouse address is repeated in every record that refers to a part stored in that warehouse.
If the address of the warehouse changes, every record referring to a part stored in that warehouse must be updated.
Because of the redundancy, the data might become inconsistent, with different records showing different addresses for the same warehouse.
If at some point in time there are no parts stored in the warehouse, there may be no record in which to keep the warehouse's address.


3rd Normal Form:

Third normal form is violated when a non-key field is a fact about another non-key field.
Example:
R(Employee,Department,Location)
Here the key is Employee. But Location is for the Department(Another non key). So it violates 3rd Normal Form.
Decomposition:
R1(Employee,Department)     and R2(Employee,Location)


The problems here were:
The department's location is repeated in the record of every employee assigned to that department if department location changes, every such record must be updated.
Because of the redundancy, the data might become inconsistent, with different records showing different locations for the same department.
If a department has no employees, there may be no record in which to keep the department's location.


To summarize, a record is in second and third normal forms if every field is either part of the key or provides a (single-valued) fact about exactly the whole key and nothing else.

Sunday, November 20, 2011

Virus in Sun Solaris System

Yes thats right, Virus in Sun Solaris System, But not actually.
Its usually considered that unix based systems are virus free. But that does not mean that they are virus free. At least not if they are part of network sharing resources with window systems.
Today I got a taste of this.
There was a folder in Sun Solaris machine shared with windows server machine. RWX permission given to server application for the folder. Recently we started noting that all of a sudden a large number of files with garbage name.exe or garbage.pif and more, started appearing in the shared folder. We deleted the files and again they appeared. We thought there was a bug in the application somewhere which was creating these files. But after a lot of observation, follow up and all we came to the conclusion that there was Virus ( Sality......) in windows system which was responsible for mysterious appearance of those files.
The actual problem was that we knew that our windows server was infected with virus and even formatted it many times but every time these virus will reappear out of the air. Now problem known, fixed and a LESSON LEARNT.

MORAL OF THE STORY:
Dont believe everything you are thought. A supposedly  secure unix system can still carry virus for other systems without itself being affected.

Thursday, November 17, 2011

My Future

Yes it is very hard to visualize your future if you are a computer student and in India.
Hardware.... Software.....Programming....... may be Networking
Very difficult to choose..  even more difficult to remain loyal to your choice.
But yes it is fun all the same, the uncertainty, it can sometimes be blessing in disguise.
Market changes every day, and opportunities also change.
May be we should try to be JACK OF ALL  till you are dead sure that you can now become MASTER OF SOMETHING.

As of now    for me,  first phase is on... 

Wednesday, November 16, 2011

My First Blog

Still confused about how to start my first blog. Should it be about me? or my MCA? or??

May be I will combine all into one blog.
Something about me, my life  i.e. personal
Something about my passion computers
May be something about things I like.
And may be somewhere in near future something that may help someone get some answers.

Late to start, confused with content, Hope it will finally lead to something really nice.