How do you avoid column name conflicts?

前端 未结 8 1148
挽巷
挽巷 2021-01-05 12:35

I was recently assigned a task of creating an auction system. During my work, I met numerous occasions where my SQL queries that contained joins failed to execute due to amb

8条回答
  •  -上瘾入骨i
    2021-01-05 13:21

    Change your naming convention so that each data element has a unique name in the schema e.g. auction_id, bid_id, user_id, etc. Ideally the name of the data element will not change between tables but sometimes you will need to add a qualifier to create a synonym e.g. adding_user_id and bidding_user_id if user_id appeared twice in the same table. You should document data element names and their synonyms in a data dictionary.

提交回复
热议问题