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

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,788 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,044 questions
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.
1,291 questions
C#
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.
11,044 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 67,096 Reputation points
    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 Answers by the question author, which helps users to know the answer solved the author's problem.