Demat and trading accounts refer to accounts used with online stock trading. They are both necessary accounts and are used in conjunction with one another.
A trading account is an account set up for online trading. Money is transferred in and out of the account at the owner's demand. It is set up through an online investment company or financial firm and no broker is involved. The owner of the account manages all trades that occur with the account.
Demat stands for dematerialised account and is used with a trading account. A demat account is the place where all shares of stock purchased are stored. Shares come in and out of the account as requested by the owner of the account.
A trading account is necessary because this is where funds come from and are paid out of. A demat account is required with almost all online trading companies. It is needed because the market no longer uses the physical form of shares. Demat accounts take the place of physical shares.