There is no way you can end up with 0% alcohol. If you used extract (pre-made wort), you WILL have sugars. Water has a SG of around 1.000. If you add extract to water, there is absolutely no way to have a SG reading of 1.000. Therefore, if you added yeast, there is no way to end up with 0% alcohol.
Like others have said, %alcohol is calculated based on the original gravity (before fermentation) and the final gravity (after fermentation). Alcohol has a similar specific gravity to water. Water with stuff dissolved in it (read sugars) has a higer specific gravity. When yeast eat sugars, they convert it to CO2 and alcohol. The more the yeast eat, the more the specific gravity will drop. If your specific gravity drops from your original reading, you have alcohol. How much all depends on how high the original gravity was, hence the term "high gravity" for beer with a lot of alcohol.