Equality of UI input elements vs. database table entities

Reza Jaferi 331 Reputation points
2023-11-17T19:08:39.74+00:00

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.

Invoice UI

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.

ERD

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.

Click to download the database

Developer technologies | Windows Presentation Foundation
SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
SQL Server | Other
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 82,061 Reputation points Volunteer Moderator
    2023-11-17T21:27:19.1666667+00:00

    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.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.