Professional Documents
Culture Documents
In next slide, it is about SQL diagram and Phúc Leader will explain
clearly to you about this.
The next one is our ER Diagram. We have 3 relationships.
1. The first one between “weather” and “location” are 1 to many
relations because 1 location has many weather records but 1
weather record only belongs to 1 location.
2. The second relationship between the user table and location table
is also a 1 to many relations because 1 user has only 1 location but
1 location has many users.
We subdivide each part of the diagram to show clearly the keys and
attributes of each table.
In the location table, the primary key is locationID, and the other is the
attribute.
In the weather table, locationID and date is the primary keys, and the
other is the attribute.
In the last table, userID is the primary key, email and phone are
multiple attributes and profile_image is the composite attribute. The
rest of the table is the attributes.