Associative entities and third normal form in a simple database

Piotr Koller

I'm interested in basic database design. I wanted to design a simple database with states and national parks. Because one state can have many national parks and one national park can be located in many states, I think they should be related as many-to-many.

In this type of relation associative entity is required and this is my design.

entity-diagram

I'm not sure about relations between entities and associative entities. I've done it this way, because:

  • individual state doesn't have to be a location of any national park

  • one state can be listed with many national parks

therefore, one(optional)-to-many(optional) between "State" and "state_park"

  • each national park has to be located in at least one state

  • each national park can be located in many states

therefore, many(optional)-to-one(mandatory) between "state_park" and "State"

I want to know whether my way of thinking is correct or not?

I also want to know what type of data would violate Third Normal Form in my database? I don't think population or area violates this, because it depends on both "id (PK)" and "Name".

Gholamali-Irani

As your explanation, I think your first model should be like below (UML Notation):

enter image description here

  1. Each State can have 0 or more (0..*) National Parks. (optional for state)
  2. Each National Park can be located in 1 or more (1..*) State(s). (mandatory for national park)


And if we map this many-to-many relationship:

enter image description here

  1. Each National Park should participate in at least one State_National_Park. (mandatory for national park)
  2. Each State can be participate in 0 or more (0..*) State_National_Park(s). (optional for state)
  3. But, each State_National_Park (each instance/record that exist in that entity/table) should have one State and one National Park.

Notice that: cardinality of the optional and mandatory participation are shown in other side of relationships. For example in first model, National Park has mandatory participation, so in the other side of our model we use 1..* (not 0..*).

Also, this model is in 3NF. (However the definition of Area is ambiguous)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Database: Can I have nullable attributes in a third normal form database?

Confusion with city/country when bringing database to third normal form

Third (?) normal form of a relation

Third Normal Form Conditions

Flask-SQLAlchemy and Third Normal Form

Third Normal Form (3NF)

Finding highest normal form of a relation of database

Is a database design's normal form the least of the normal forms of its tables?

how to process my array to be associative on first two levels and on third to have simple value

Is there simple way of changing timezone between dto and entities at database?

Adding a third parameter to an associative array

combining database tables in 3rd normal form

My simple html php form not inserting into database

Simple form to database with Code Igniter 3 not working

Trying to POST to database with Simple Form and Rails

How to properly normalize this given table up to third normal form(3NF)?

HTML entities to normal strings in PHP

Basic Java MVC: Beans and associative entities with attributes

PHP push associative array in normal array

which database should I use for simple log in register form in android

JPA Entities not saved in the database

Spring Entities Not Saved To Database

Room database - edit entities

Describing entities in a database

How to update entities and database

ckeditor entities html database

How to fetch the orbeon form (yform) data that got stored in database in xml file? How to send that to third party apps?

post normal form with dropzone

Decomposition into second normal form