mysql - Lot of redundancy in passenger table -
i working on project related ticket booking. can store passenger data i.e. name,age,sex along ticket id in passenger table. problem if ticket booked same passenger have re-enter same passenger data & ticket id differ.
mysql> desc passenger; +-------+-------------+------+-----+---------+-------+ | field | type | null | key | default | | +-------+-------------+------+-----+---------+-------+ | name | varchar(32) | no | | null | | | age | int(11) | no | | null | | | sex | char(1) | no | | null | | | pnr | varchar(32) | yes | mul | null | | +-------+-------------+------+-----+---------+-------+
can please tell me how can minimize such redundancy?
any link,reference,clue or idea appreciable. thank you
you store passenger entity, consisting of name/age/sex etc. (in passenger entity table) , passenger booking table contain passenger entity ids (integers, guids etc.). form of normalisation.
however may optimisation far. whether depends on how many duplicate entities etc. have, , whether they're real performance/management issue you. e.g. expect store more data passengers (addresses, frequent flyer info etc.).
Comments
Post a Comment