New answers tagged

7

New Answer (based on new details provided in updates to the Question) One thing to consider is that a Primary Key and a Clustered Index are not the same thing. A Primary Key is a constraint and deals with the rules by which the data lives (i.e. data integrity); it has nothing to do with efficiency / performance. A Primary Key requires that the key column(s) ...


4

SQL Server will automatically add a 4 byte integer uniqueifier to all duplicate (ie second and subsequent for a key value) clustered index keys to make it unique. This is not exposed to the user though. The advantage of adding your own unique identifier as a secondary key column is that you can then still seek by companyid but also seek to individual rows ...


2

ORA-02256: number of referencing columns must match referenced columns Cause: The number of columns in the foreign-key referencing list is not equal to the number of columns in the referenced list. Action: Make sure that the referencing columns match the referenced columns. The problem is the foreign key should reference both columns used in the ...


1

Yes. This is a common scenario when implementing 0..1 relationships.


3

Your decomposition is not correct, since in R2 you still have dependencies that violates the BCNF, for instance UtilisateurID → Nom (UtilisateurID is not a key of that relation). The problem is that your algorithm is not correct. When you find a dependency X → A that violates the BCNF, you should decompose a relation in two relations, the first with X+, not ...



Top 50 recent answers are included