Simple guide to help you on your web-dev journey
View the Project on GitHub KeaCluster/bookstoreAPI-spring-guide
This section will focus on:
The database design for our library system revolves around three key entities:
Book
, Order
and User
and one pivot table: OrderDetails
.These entities encapsulate the basic details required by our system. Relationships are structured to ensure data integrity, querying and manipulation.
According to our system’s requirements, the design will be as follows:
User
can rent multiple Books
, and Books
can be rented by multiple User
.
Order
.Order
itself is a simple entity containing only a relationship to a pivot table.In addition to the previous tables, we’ll need to implement a pivot table in order to manage M:N relationshps:
The ER-Diagram will help us visualize the relationship between entities in our database. In our bookstore system the ER-Diagram will look something similar to the following:
Normalization is performed to minimize redundancy and dependency. All in order to ensure a good structure and organization or the data.
There are three main steps to Normalization:
You can write (or generate) the SQL script through any tool you prefer. Stick to the previously mentioned relationships and attributes for better results.
If you’re using this as a resource, more than a guide, just remember to double check your requirements.