It's the same mindset. An attachment is a file that the email sender has included along with the text email, such as a picture, a file, or joke. A computer virus can be easily attached to an email and the sender can make it appear to be sent from a trusted friend or family member. This is done in many ways. You virus attacks the victim's email address book and forwards the virus to everyone in the address book.
Most viruses have the file extension .exe.
They are programs just like Microsoft Word or Excel. Some viruses are especially sinister and infect the user when they view an infected web page. In the background, they download a program to your hard drive, just like web pages that require a special plug-in. Nearly all anti-virus programs have websites where you can download the current .dat files to update your software. Check the program.