I keep messing up 1NF

前端 未结 4 1463
逝去的感伤
逝去的感伤 2021-01-25 07:51

For me the most understandable description of going about 1NF so far I found is ‘A primary key is a column (or group of columns) that uniquely identifies each row. ‘ on www.phlo

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-25 08:19

    use Object Role Modelling (say with NORMA) to capture your information about the design, press the button and it spits out SQL.

    This will be easier than having you going back and forth between 1NF, 2NF etc. An ORM design is guaranteed to be in 5NF.

    Some notes:

    • you can have composite keys
    • surrogate keys may be added after both conceptual and logical design: you have added them up front which is bad. They are added because of the RDBMS performance, not at design time
    • have you read several sources on 1NF?
    • start with plain english and some facts. Which is what ORM does with verbalisation.

    So:

    1. A Customer has many pizzas (zero to n)
    2. A pizza has many toppings (zero to n)
    3. A customer has an address
    4. A pizza has a base
    5. ...

提交回复
热议问题