Mysql constraints

Hii i am building a financial database. And I have data for each stock for all the days. I want to avoid multiple entry of a stock for the same timestamp in the database. For eg I dont want to have the data for google on 30 jun 2010 twice. How can i do this

as the saying goes…

failure to plan adequately on your part does not constitute an emergency on our part

to avoid duplicate entries, declare a UNIQUE index on the key column(s) for those entries


ALTER TABLE stocks ADD UNIQUE stock_day_ix ( stock_code, value_date )

Please reply asap. Thanks in advance