the first question is can a buyer buy from two different sellers? can a buyer have more than one order? it sees like the buyer/seller relationship would be at the order level.
Equality of UI input elements vs. database table entities
As you can see in the following image, the user interface of my app has a total of 12 text boxes (6 text boxes in each part) in the seller and buyer sections.
The image below is a part of the ERD relating to this application's database; since the relationship between these two tables is one-to-many, an additional entity (Seller ID
) is defined in the Buyer detail
table in comparison to the user interface.
When a user enters data from the UI, I want the Seller ID
value to be automatically inserted into the database.
Based on the above explanation, is this type of application design (user interface and ERD) correct?
If this approach is not correct, please provide a standard approach that keeps to ERD design principles and clean code.