What is a Malicious Program/Malwares? Check the difference between malwares – Virus, Worm, Root Kit, Trojan Horse and Types of Virus

Hi friends, today I am writing about malicious programs – Virus, Root kit, Trojan horse etc and the types of viruses. So, firstly it is very important to know What is malware? It is an important topic for exams like IBPS IT officer, Assistant Manager (IT), SBI IT officer, GIC Officer Scale – I, Computer Teacher, Computer Engineer or any other computer engineer related post.

Looking over the importance of this topic, I am explaining this in detail and will also share a questionnaire on it soon. So stay updated with this website and let me know if you want more on this topic. Let’s first understand what Malicious Program is.

What is Malicious Program/Malwares?

Malicious software, which are commonly known as Malwares are a type of software that can harm your computer system. These programs come in different forms for example: viruses, trojans, worms, spyware, adware, root kit, zombie, key loggers etc.

These programs can delete documents, modify or steal the protected data and also add software to your computer programs which are not approved by user.

Hope you get a basic idea of the dangerous nature of these programs. Now, let’s move to the core concepts of this Malicious Programs section so that IT officer post or any computer science post people can answer the questions related to malicious programs.

Malicious Program

Types and Forms of Malicious Programs

Forms of Malicious Programs
Type/Form of Malicious ProgramDescription
VirusIt attaches itself to a program and propagates copies of itself to other programs and thus harm the data.
WormIt is a program that propagates copies of itself to other computers basically through Network
Trojan HorseIt is a program that contains unexpected additional functionality
Backdoor (Trapdoor)Program that allows unauthorized access to programs and  functionality
Logic BombIt triggers action when a specific condition occurs
ExploitsIt is a code specific to a single vulnerability or set of vulnerability
Auto-rooterMalicious hacker tools which are used to break into new machines remotely
Downloader’sUsually downloader’s are sent in an email. It is a program that installs other items on a machine that is under attack.
Key LoggersIt captures keystrokes on a compromised system. Think a program is stealing your credentials details during a transaction
ZombieProgram activated on an infected machine that is activated to launch attacks on other machines
Root KitThese are Set of hacker tools used after attacker has broken into a computer system and gained root-level access
FloodersFlooders are used to attack networked computer systems with large volume of traffic to carry out a denial of service attach (DoS) attack.
Spammer ProgramsSpammer programs are also a kind of malicious software. These are used to send large volumes of unwanted emails
Kit (Virus Generators)Kit is a set of tools for generating new viruses automatically

I have tried to provide the maximum information that covers most of the questions from Malicious Programs section for government exams. Also, if you want to learn basics of SQL, then follow.

Difference between Computer Virus, Computer Worm, Trojan Horses and Bots

Computer Virus vs Computer Worm :

Computer worms are similar to viruses in the manner that they replicate the functional copies of themselves and can cause the same type of damage. But, still there are some differences in the way these malicious programs cause damage.

In contrast to Viruses, which require the spreading of an infected host file, worms do not require a host file to propagate. Instead, worms are standalone software that do not require any host program or human help to propagate from one computer to another. Now let’s see some basic difference between these malicious programs/malware programs:

Virus :

Computer viruses attach a copy of itself to files or programs, infecting each computer it comes across as it spreads. It usually spreads through Emails or executable files. Some viruses are very annoying because they slow down your computer, while others can wreak havoc on your system. Viruses usually modifies files or it may sometimes change the location of a file.


Computer Worms also replicate themselves but unlike viruses, these malicious programs do not attach themselves to a program. Instead, these spreads from computer network to network and are extremely dangerous.

These can also damage the servers. Computer worms usually do not infect files. Instead these monetize your computer memory or CPU.

Trojan Horses:

These malicious programs are sneaky ones. Trojan horses hides all sorts of malicious goodies and can harm your computer. These malicious programs may look legitimate software at first glance, but when you install these programs they can delete or modify your files.

Unlike viruses and worms, Trojan horses do not replicate themselves.


Bots are a type of malicious programs that may have good intent sometimes. These self-replicating malware is designed to retrieve some sorts of information from the infected system. Bots rarely announce their presence. These malicious programs infect networks in a way that escapes immediate notice.

Life Cycle of Virus/ Phases of Virus:

During its lifetime, a typical virus goes through the following four phases:

  1. Dormant Phase: In this phase, the malicious program Virus is idle. The virus will eventually be activated by some event, such as a date or the presence of another program of file. Not all virus have this stage.
  2. Propagation Phase: In this phase, the virus places an identical copies of itself into other programs or into certain areas on the disk. Each infected area/program in the computer system will now contain a clone of the malicious program Virus.
  3. Triggering Phase: In this phase, the virus is activated to perform the intended function. The triggering phase can be caused by a variety of system events like a specific date or exceeding the disk space to a limit.
  4. Execution Phase: In this phase, the virus perform the intended function. The performed function may be harmless or can damage files or programs of the system.

Nature of Viruses:

Viruses are designed in a way to take advantage of the details and weakness of a particular system. These malicious programs are usually specific to a particular hardware platform or a particular operating system in some cases.

Hope the nature of these malicious programs is clear up to this point.

Types of Virus:

There are numerous types of viruses but I am sharing the most significant types of Virus here. With the enormous growth of technology and available data, the count of virus types is growing. New viruses are being developed and used. So, here is the list of the most common types of viruses:

Types of Virus
  1. Memory-Resident Virus: It lodges in main memory as part of the resident system program. From that point on, the virus infects every program that executes.
  2. Stealth Virus: This malicious program/malware is explicitly designed to hide itself from any antivirus software. The purpose of the stealth virus is to defeat the virus detection/scan process. To achieve this, the signature of the virus with vary with each replication. The virus may insert superfluous instructions or can also change the order of the independent instruction inside a program.
  3. Parasitic Virus: This is the most common form of virus. A parasitic virus attaches itself to the executable files and replicates. Thus this virus infects other executable files when the infected executable file is executed.
  4. Boot Sector Virus: This virus infects the boot record or the master boot record and thus can prove to be very harmful for the system. Infecting the master boot record, this malicious program spreads when the system is booted with the disk containing the concerned virus.
  5. Polymorphic Virus: This virus mutates itself with every infection, thereby making the detection of the virus impossible.
  6. Metamorphic Virus: This is similar to polymorphic virus, with one difference that it rewrites itself completely with every infection. Hence, these virus change the detection very difficult. The metamorphic virus may change their behavior as well as appearance.

Phew… finally I was able to frame all the useful information related to malicious program – Network Security section in this post. Please comment below for any feedback or suggestions. For theon this section please read my next post here.

Post Views: 8,417

SQL Basics and Different Databases


What is a Database?

Database is an organized collection of related information. In daily world we deal with lots of data. In this internet technology more and more data is getting produced these days. We have multiple database management systems available with us to manage, store and update this enormous data in convenient way. e.g. Oracle, Sybase, Microsoft SQL server management studio etc.


DBMS (Database management server) is a collection of software tools used to manage, update, retrieve the data from the database. SQL (Structured query language is used to connect the DBMS with the database.


All queries have been executed on the Microsoft SQL Server management Studio version 17.0. SSMS is a client tool and not the server. It is rather used as a tool to connect to the database server.

Settings: Local Host

Connect: Database Engine

Use SQL authentication username and password

SQL Databases:

In Microsoft SQL Server Management Studio you will find two types of databases:

  1. System Database
  2. User created Database

-System database can’t be deleted

SQL Command Types:
  1. DDL (Data Definition language) – Used to define/create database object
  2. DML (Data manipulation language) – Used to insert values, update and delete values from the database object created by DDL commands.
  3. TCL (Transaction Control language) – Used to control transactions through Commit and Rollback commands

SQL DDL Commands – data definition language (Create, Alter and Drop commands)

1. Creating a database:

Database can be created either using GUI or through SQL query in SSMS.

Create statement is used for this purpose: Create [Database Object] [Database Object name]

Ex. Create Database db1 (this statement will create a database with name db1)

Whenever we create a database, two types of files are created with it: 1. .MDF file (contains actual data) 2. .LDF file (contains log file)

2. Modify a Database:

Alter statement is used to alter a sql database object.

Alter Command:  Alter [Database Object] [Database Object name] Modify Col1 = Value

E.g. Alter Database db1 Modify Name = db2 (this will change the name of the database)

Renaming through stored procedure: sp_renameDB [Old database name] [New database name]

e.g. sp_renameDB db1 db2

3. Dropping a Database:

Drop statement is used to delete a database completely from the system(.mdf and .ldf files are also deleted with it)

Drop command: Drop [Database Object] [Database Object name]

e.g. Drop Database db1 (this will delete database db1)

Note- If a database is getting used by any other user, make sure that database is not getting used by any other database. Else an error will be generated

Resolve this single user thing, use this command:

Alter Database db1 set Single_USER with Rollback immediate

(Rollback immediate, rollback any commands and delete the database immediately)

SQL DML Queries : Insert, Update, delete

1. Create a Table:

Command: Create Table [table name] ([column name] [data type of column] [constraint])

e.g. Create table t1(ID int NOT NULL Primary Key, Gender nvarchar(20) NOT NULL)

This command will create a table with name t1 and 2 columns ID and Gender of INT and nvarchar datatypes respectively. nvarchar is a UNICODE data type and store 2 bytes per characters, while varchar stores 1 byte per character.

In order to store the table in a particular database use the following command:

Use [database name]


Create table command….

Primary Key – Can’t be null and must be unique. It uniquely identify each row in the table

Foreign key– It can contain null values and it references primary key present in some other values (basically the column in which it looks for a value). Foreign key is used to establish relationship between two tables. It is used to enforce database integrity.

Create a Foreign key relation –

Alter table [table name] add constraint [constrain name] foreign key(foreign key column name) references [PrimaryColumn Table Name] (primary key column)

e.g. Alter table tb1 add constraint tb1_genderid foreign key(tb1) references tb(id)

Note- Constraint name should make sense like tablename_columnName

2. Select all values of a table:

Command: Select * from [table name]

To select all tables of a database choose:

Select * from dual (dual refers data dictionary)

3. Insert values in a table :

Insert command is used to insert values in a table: Insert into [table name] (col 1, col 2, …) Values(col 1 value, col 2 value,…)

e.g. Insert into a1(id, name, gender) values(11, “ss”, “male”)

4. Adding a Default value in a column:

We can assign default values to a column rather than assigning Null values:

Alter table [table_name] add constraint constraint_name Default [default value] For [column name]

e.g. Alter table tb1 add constraint tb1_gender default 2 for gender

This command will assign default value 2 to column gender if value not explicitly defined.

5. Adding a New column into table:

Command: Alter table [table name] add [column name] [column data type] [NULL|NOT NULL] add constraint [constraint name] Constraint

Alter table tb1 add Address nvarchar Not Null add constraint tb1_address default ‘xyz’

This command will add one column Address to the table tb1 that don’t accept null value. Also, default value of ‘xyz’ will be assigned to it.

6. Dropping a Constraint:

Command: Alter table [table name] Drop Constraint [constraint name]

e.g. Alter table tb1 drop constraint tb1_gender

This will drop the constraint.

7. Delete a Table record:

To delete a table record, we use delete command:

Delete from [table name] where column1=”column value”

Note: Where clause is used to put some condition on search selection

However, you can’t delete a table record if the table is getting used by some other user. There are some cascading referential integrity constraint imposed on foreign key constraints.

8. Cascade Referential Integrity Constraint:

We can choose options if a foreign key constraint reference is getting deleted. Four options are there:

  1. No Action : This will simply generate an error if a record from primary key table is deleted that has some value in foreign key table.
  2. Cascade: This option will delete all the foreign key records that are related to primary key will be deleted
  3. Set NULL: This option will set the foreign key dependent value to Null.
  4. Set Default: This option will set the foreign key dependent value to default values provided to the column.

9. Adding a Check Constraint:

This constraint is used to enforce value checks on column. For e.g. The value in the age column>4

Command: Alter table [table name] add constraint [constraint name] check (boolean expression)

e.g. Alter table tb1 add constraint tb1_age_check check(AGE>0 AND AGE<30)

This command will only let you add age between 0 and 30 in the Age column.

Note: The check constraint returns a Boolean value based on which the value is entered in the table. It also let you insert Null values because for Null values, check constraint returns “Unknown”.

10. Identity Column:

It is a column property in SSMS.

Identity column is a column to which values are automatically assigned. There are different properties linked to this column. Please set up following values while creating identity column:

Identity Seed: A value with which the identity column value starts

Identity Increment: The value with which identity column value is incremented.

CommandCreate table stu(id int identity(1,1) Primary key)

This command will create a stu table having id as a identity column. The id column here will start from 1 and incremented by 1.

10. Setting up External Values/Explicit Value to Identity Column:

To set up external value in Identity column, add the following command before inserting values in table:

Command: Set IDENTITY_INSERT [table name] ON

Insert into table name(column list) values(1,”23″..etc)

11. Setting Off External Values/Explicit Value to Identity Column:

Command: Set IDENTITY_INSERT [table name] OFF

Insert into table name(column list) values(1,”23″..etc)

Note: To reset the identity column value, use DBCC command.

12. Unique Key Constraint:

Unique key constraint is used to enforce unique values in database. There is a slight difference between primary key and unique key.

Primary key values = Unique+Not Null

Unique constraint value = Unique + values can be null

CommandAlter table table_name add constraint constraint_name unique(column name)


Create table Stu(Name varchar(20) Unique)

13. Applying a Trigger:

Firstly let’s try to understand what a trigger is. A trigger is an sql instruction/set of instructions that will will cause an action once a specific condition occurs. For example: Inserting another row table 2 when a row is entered in the table 1.


Create Trigger [trigger_name] on [table_name] for Insert/Update/Delete/Condition





14. Selecting values from table:

Select is a command used to retrieve records from a table.

  1. To fetch all records from a table:

Command: Select * from [table_name]

e.g. Select * from emp

2. Select specific columns from a table:

Command: Select [col_name_1], [col_name_2]… from [table_name]

e.g. Select name, age, id from Employee

3. Fetch all distinct records from a table:

Command: Select distinct [column_name] from [table_name]

e.g. Select distinct name from Employee

This command will help in fetching the distinct records from table Employee by Name column.

4. Fetch record matching a specific condition:

Where is used to apply a specific condition in the SQL command.

Command: Select * from table_name where column_name = condition value

e.g. Select name, id from employee where name=”John”

This command will fetch all the records from the table with name column value as john.

5. Fetch record not matching a specific condition (column value):

Command: Select * from table_name where col_name <> Column value

“<>” signifies as not equal to here. We can also use “!=” to compare values.

6. OR operator in SQL:

OR operator is used to specify two or more conditions together.

Command: Select * from table_name where col1=value OR col2=value

e.g. Select name, age, salary from Employee where name=”John” OR name=”Nick”

This sql command will fetch all the table records where name is either John or Nick

7. AND Operator in SQL:

AND operator is used to specify two and more conditions together.

Command: Select * from table_name where col1=value AND col2=value

e.g. Select name, age, salary from Employee where name=”John” AND age=”30″

This sql command will fetch all the table records where name is John and age is Nick

8. IN Operator in SQL:

IN operator is used to retrieve records where condition matches more than 1 value. (And you don’t want to use OR multiple times in a sql command)

Command: Select * from table_name where col_name IN(value1, value2, value3…)

e.g. Select * from Employee where age(21, 25, 30)

This command will fetch all the table record where age is either 21 or 25 or 30.

SQL Wildcards

SQL supports various kind of wild card characters to facilitate data retrieval in multiple ways. Please refer the image for all sql wild card characters.

The DataBird

Post Views: 2,025