New answers tagged

0

I've only quickly looked at this but my first thought is to utilise NULL attributes in your Users table for EmployeeId and ClientId. They can then be populated as required and defined as Foreign Keys. UserName is the Primary Key for the Users table. Use the UNIQUE attribute on the EmployeeId, ClientId and the composite EmployeeId+ClientId within the Users ...


0

It may be useful to view your case as two problems, rather than one. The first problem is a class-subclass (or, if you prefer, type-subtype) problem. Employees and Clients are clearly subclasses of some superclass that you have left unnamed. I'll call them Persons. (See the subtypes tag). The second problem is the one-to-one relationship between Persons ...


1

First of all, let me just say (as others have pointed out), that there is nothing wrong with having mutually-exclusive foreign keys! Second, despite it's elegance and applicability to other scenarios, I don't think the superset solution posted by @Joel Brown is appropriate for your exact case. Although it makes it much easier to deal with sub-types of ...


1

It is acceptable to have mutually exclusive attributes in a table. If you only have one pair of such attributes, this may be the most practical solution. However, some people may look at your situation as a sub-typing issue. In this view, you are missing the superset entity. You have a collection of (something), some of which are employees and some of ...


2

Todd's answer is excellent. Here's an over simplified answer. There are pros and cons to normalization, beyond 1NF. The biggest pro to normalization is that it prevents mutually contradictory facts from being stored in a database. when the same fact is stored in more than one place, it becomes possible to store mutually contradictory versions of that ...


3

Your question really is not about normalization. Instead it is about specialization vs. generalization with respect to design. Let me give some background to show why this is the case. Background A table is a relational (R-Table) table, and thus normalized (meaning in 1NF by definition) if in its design a discipline is followed that ensures: Distinct, ...



Top 50 recent answers are included