sql - Multiple foreign keys to a single column -


I am defining a database for a customer / order system where there are two very specific types of clients. Because they are very different in the same customer table, they will be very ugly (it will be filled with empty columns because they are meaningless for one type)

Although their orders are in the same format, is it possible to have a customer ID column in my order table, in which the customer type is a foreign key of both? I have set it up in SQL Server and I have no problem creating relationships, but I am still trying to include any data.

In addition to this, I am planning to use an NHM as an ORM, can there be any problems introduced by doing such a relationship?

You can not have a single field in the form of a foreign key for two different tables Where would the key be?

You will need at least one field that explains what kind of user is or two different foreign keys.

You also can keep the information that is common to all users in a table and there are separate tables for that information that is specific to the user type, so that you have the primary key As there is a table with the User ID


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -