How do I set up primary keys for a relationship?

I want to know how to properly set up primary keys in a relation. For example. we have an ER diagram containing the elements:

  • Key Attributes
  • Weak key attributes
  • Identifying relationships
  • Associative objects

To translate it into a relational model, we have to do some tricks. All of the items above deal with the primary keys of the relationship, but they are all Natural Keys - so we can leave them as they are or replace them with surrogate keys .
Let's consider some cases.

Case 1

The key attribute is the name - so it must be of type CHAR

or VARCHAR

. Usually names become key attributes.

Case 2

Two (or more) identifying relationships become the composite primary key of the relationship (which is made from foreign keys).

Case 3

Identifying relationships with weak key attributes also becomes a composite master key.

Case 4

Associative Objects usually have two or more Identifying Relationships, so they must be Relationships (Junction Tables).

  • How do I configure the primary keys for the relationship to handle all of the above cases (maybe a few more cases I haven't mentioned)?

  • How to avoid using surrogate keys and when are they needed?

  • How do I set up data types for primary keys?

  • If a composite primary key is to be passed to a child relationship, will it be replaced with a surrogate?

Advantages and disadvantages of using surrogate keys in my opinion:

Benefits

  • They are compact (usually of the type INT

    ) and are sometimes a good replacement for composite keys.

  • They are illustrative when they are in Foreign Keys

  • They are indexed painlessly

disadvantages

  • They are numbers and meaningless. For example. I want to populate the Junction table in my front-end application - so I have no choice but to link only numbers

  • They are redundant

  • They confuse

As for creating datatypes - there should be more tricks and also setting up primary keys in general.

Update

I had to give an example first, but I didn't. So here's an example. We have two main entities that interact with each other (don't know how to illustrate things like the diagrams here yet, so I'll show them as tables that should demonstrate the International Space Station's crew rotation system):

SpaceShip

╔════════════════╀════════════════╗
β•‘ ShipName       β”‚ ShipType       β•‘ ShipName - Primary Key
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’ ShipType - Foreign Key (but it is
β•‘ Soyuz TMA-14   β”‚ Soyuz          β•‘   not being considered here)
β•‘ Endeavour      β”‚ Space Shuttle  β•‘
β•‘ Soyuz TMA-15M  β”‚ Soyuz          β•‘
β•‘ Atlantis       β”‚ Space Shuttle  β•‘
β•‘ Soyuz TM-31    β”‚ Soyuz          β•‘
β•‘ ...            β”‚ ...            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

      

AND Crew

╔════════╀══════════╗
β•‘ CrewId β”‚ SallSign β•‘ CrewId - Primary Key (used Id 'case crew is usually
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’   shown as crew members - it has no particular
β•‘ 4243   β”‚ Astreus  β•‘   name)
β•‘ 4344   β”‚ Altair   β•‘ CallSign - attribute (it may not be assigned or
β•‘ 4445   β”‚ ...      β•‘   explicitly shown - i.e. it can be NULL)
β•‘ ...    β”‚ ...      β•‘
β•šβ•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•

      

These two objects interact through Flight

. Each flight brings one crew to the ISS and returns another or the same crew. Obviously, the relationship between Flight

and Crew

is many-to-many, and that requires a join relationship (table). But we can't just link SpaceShip

and Crew

because of the spaceships - the spacecraft can be reused (returned), for example, space shuttles.

So it Flight

should look like this:

╔═══════════════╀════════════╀═══════════════╀═════╗
β•‘ ShipName      β”‚ FlightName β”‚ ShipFlightNum β”‚ ... β•‘ ShipName, FlightName
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β•’   are composite PK
β•‘ Soyuz TM-31   β”‚ NULL       β”‚ 1             β”‚ ... β•‘ ShipFlightNum
β•‘ Atlantis      β”‚ STS-117    β”‚ 28            β”‚ ... β•‘   depends on whole
β•‘ Soyuz TMA-14  β”‚ NULL       β”‚ 1             β”‚ ... β•‘   Composite PK
β•‘ Endeavour     β”‚ STS-126    β”‚ 22            β”‚ ... β•‘ ... - other
β•‘ Soyuz TMA-15M β”‚ NULL       β”‚ 1             β”‚ ... β•‘   attributes which
β•‘ Endeavour     β”‚ STS-111    β”‚ 18            β”‚ ... β•‘   depend on PK
β•‘ Atlantis      β”‚ STS-122    β”‚ 29            β”‚ ... β•‘
β•‘ ...           β”‚ ...        β”‚ ...           β”‚ ... β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•

      

So Flight

has a composite primary key (the flight name for the Soyuz spacecraft is the same as the name of the spacecraft, but it is different for reusable spacecraft such as the Shuttle) and it must be related to Crew

how many-to-many. Here is part of my difficult question - if this composite primary natural key should be replaced with a surrogate?

And if we are going to work with Natural Keys further, then the new transition relationship (associative entity) should look like this:

Designation

(Crew designed for flight)

╔═══════════════╀════════════╀════════╀══════════╗
β•‘ ShipName      β”‚ FlightName β”‚ CrewId β”‚ CrewType β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Soyuz TMA-15M β”‚ NULL       β”‚ 4243   β”‚ Deliver  β•‘
β•‘ Soyuz TMA-15M β”‚ NULL       β”‚ 4243   β”‚ Return   β•‘
β•‘ Soyuz TMA-15M β”‚ NULL       β”‚ 4445   β”‚ Backup   β•‘
β•‘ Soyuz TMA-16M β”‚ NULL       β”‚ 4344   β”‚ Deliver  β•‘
β•‘ Soyuz TMA-17M β”‚ NULL       β”‚ 4445   β”‚ Deliver  β•‘
β•‘ Soyuz TMA-18M β”‚ NULL       β”‚ 4344   β”‚ Return   β•‘
β•‘ Endeavour     β”‚ STS-111    β”‚ 55     β”‚ Deliver  β•‘
β•‘ Endeavour     β”‚ STS-111    β”‚ 44     β”‚ Return   β•‘
β•‘ Endeavour     β”‚ STS-113    β”‚ 55     β”‚ Return   β•‘
β•‘ ...           β”‚ ...        β”‚ ...    β”‚ ...      β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•

      

Here we have a 4x Composite Primary Key that has four foreign keys (CrewType also has an FK constraint). If we use surrogates instead of Naturals, the result will be more compact, but difficult to fill (in my opinion).

Another update

Another case for a table (relationship) TypeCrew

:

╔══════════╗
β•‘ CrewType β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Deliver  β•‘
β•‘ Return   β•‘
β•‘ Backup   β•‘
β•‘ ...      β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•

      

Everyhing it would be nice if we didn't use these values ​​in our ( WHERE CrewType LIKE 'Backup'

) queries . If these values ​​will be replaced with alternative values ​​in other languages ​​or even with symbols, for example. >

, <

and ^

for Deliver

, Return

and, Backup

respectively ( WHERE CrewType LIKE '^'

). Adding a numeric surrogate key won't help, as its values ​​might not be the same as TypeName

( WHERE TypeId=2

):

╔════════╀══════════╗    ╔════════╀══════════╗    ╔════════╀══════════╗
β•‘ TypeId β”‚ TypeName β•‘    β•‘ TypeId β”‚ TypeName β•‘    β•‘ TypeId β”‚ TypeName β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’    β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 0      β”‚ Deliver  β•‘    β•‘ 0      β”‚ Backup   β•‘    β•‘ 0      β”‚ >        β•‘
β•‘ 1      β”‚ Return   β•‘    β•‘ 1      β”‚ Deliver  β•‘    β•‘ 1      β”‚ <        β•‘
β•‘ 2      β”‚ Backup   β•‘    β•‘ 2      β”‚ Return   β•‘    β•‘ 2      β”‚ ^        β•‘
β•‘ ...    β”‚ ...      β•‘    β•‘ ...    β”‚ ...      β•‘    β•‘ ...    β”‚ ...      β•‘
β•šβ•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•    β•šβ•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•    β•šβ•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•

      

Perhaps this is not a question of the relational model? Perhaps this is just bad design? But I couldn't think of a better one.

+3


source to share


2 answers


Position

Any practice that is not based on a solid theory is not worth considering. I am a strong relational model with a strong theoretical foundation. The relational model is based on solid theory and has never been refuted 1 . There is nothing solid about what goes for "relational theory", I took them and refuted my concepts in my space. Also, relational database design is science, not magic, not art 2 so I can provide evidence for any of the suggestions or accusations I make. My answers are taken from this position.

1. These are articles that are not related to science, and a lot of opinions from those who do not understand science, yes, but there is no scientific refutation. Just as the pygmies claim that man cannot fly, he is "true" for them, but not suitable for humanity, he is based on a complete inability to understand the principle of flight.

2. Of course, there is art in the presentations of high-profile practitioners, but that does not make science art. It is science, and only science, and beyond that, it can be skillfully delivered in models and databases.

"Relationship Theory"

I want to know how to properly set up primary keys in a relation. For example. we have an ER diagram containing the elements:

If it were ERD, then you would not be looking at "relationships", you would be looking at entities (if the diagram was early) or tables (if they were progressed). "Relationships" is a beautiful abstraction that has nothing to do with implementation. ERD or data model means implementation (not abstract, real), the intention of the physical leaves the abstract world of theory and enters the physical world, where idiotic abstractions are destroyed.

Further, "theorists" who claim to serve in the database space cannot distinguish between base relations and derived relations: while this may be acceptable in an abstract context, it is not true in an implementation context. For example. the underlying relationships are tables and should be normalized; derived relations are, well, derived, representations of the underlying relationship, which by definition are flattened representations (rather than "denormalized", which means something slightly different) of the underlying relationship. Therefore, they should not be normalized.

  • But "theorists" are trying to "normalize" derived relations. And the most damaged two are trying to define the definition of 1NF, which we had for forty-five years, which is fundamental and solid, that they themselves maintained, changed, so that their derivative relations, which do not need to be "normalized", "can be classified as β€œnormalized.” It would be fun if it weren't so sad.

One wonderful quality of the objective truth of science is that it does not change. Subjective "truth", non-science, changes all the time. What you can rely on must be understood before you start practicing, and other things are not worth reading.

Highlighting

They live in a world of their own, isolated from the reality of relational databases, in particular the relational model, and the industry they claim in ministry. Forty-five years after RM came out, they have done nothing to promote the RM or Relational databases.
  • Keep in mind that they develop all sorts of concepts that are outside of the relational model.

  • RM's progress (completing what the Neanderthals suggested was "incomplete") was only due to standardization (R Brown and others working with Codd, leading to the IDEF1X standard for relational database modeling) and the efforts of high-performance SQL vendors and their customers ...

  • These are commercial RDBMS vendors that were already established in the 1980s, not the Free-free / shareware / vapourware Non-sql groups of the last decade, which are streaming their wares as "sql", which gives you well and glued to yours. " platform "are not portable.

Worst of all, they publish books about their non-relational concepts and fraudulently call them "relational." And the "professors" blindly "teach" this nonsense, like parrots, without understanding either the nonsense or the relational model that it should investigate.

  • If you are trying to find answers to some kind of "educational" project, sorry, I cannot explain it, because "education", as you can see, is completely confused and has non-relational requirements.

  • I can, however, provide direct answers to a question driven by science, the relational model, the laws of physics, etc.

The point to be drawn from this is that Relational Theory and Practice were very close after Dr. EF Codd published his original work, and around the time that SQL platforms were developed by vendors in the post-Codd era. that the transitions for the "theory of relativity" are completely separate from this original relational theory.

  • I can list the differences, but not here. Please note: if you read my posts that touch on this topic, you can collect this data and list it yourself. Or ask a new question.

Question

I want to know how to properly set up primary keys in a relation. For example. we have an ER diagram containing the elements:

No ERD to check. Ok, in the update you have an example. Perfect for your questions because this is a set of custom data views and modeling can now begin. But please note that this is not an ERD or a model. We rely on understanding the data; analyzing it; classifying it, rather than looking at the data with a microscope. I understand that you were taught to do this.

To translate it into a relational model

Yes, this is the stated goal. The word "translate" is incorrect because RM is not just a flat or fixed set of criteria that "meets" or fits (as "theorists" know), it also provides specific Methods and Rules . Therefore, we will Model according to the relational model .

we have to do some tricks.

We don't need tricks, we use science and only science. The "theorists" and the "professors" who follow them need tricks and practice non-science. I cannot help in this regard. Also, the tricks they use tend to bypass and undermine the relational model, so watch out for them.

Surrogate

All of the items above deal with the primary keys of the relationship, but they are all natural keys, so we can leave them as they are or replace them with surrogate keys.

Well, here it is, the first trick of your "teacher".

  • Surrogates are physical record pointers (not strings), they are illogical.

  • There is no such thing as a "surrogate key", these two words contradict each other.

    • The key has a specific definition in RM, it must be composed of data . The surrogate is not made up of data, it is fabricated, a meaningless number generated by the system. Therefore, it is not a key or a "key".

    • A key in RM has a number of relational qualities that make Keys very powerful. Since the surrogate is not a Key, it does not have any of these qualities, it has no relational power.

    • Hence, "surrogate" and "key" have specific meanings, and they are quite good as separate terms, but together they contradict each other because they are opposite.

    • When people use their term "surrogate key," they naturally expect some, if not all, of the quality of the key. But they won't get any of them. Therefore they are deceived.

  • The relational model (one that theorists know nothing about) has a definite rule of path independence . As long as relational keys are used, this rule persists. It provides relational integrity 1 .

    • Using a surrogate violates this rule. Corollary 2 is that relational integrity and relational navigation 3 are lost.

    • The consequence of this is that many more connections are required to obtain the same data (no less, since the lovers of mythology and magic continue to soar).

    • Therefore surrogates are not allowed and the other has a separate account.

  • Since you are in the modeling phase, either conceptual or logical, and Keys are logical and surrogates are physical, surrogates don't have to fit into the picture. (They only come into the picture, if at all, for consideration, only when the logical model is complete and the physical model is considered.) You are nowhere close to completing the logic, so the introduction of a surrogate should raise a red flag.

    The "teacher" and the author of the "textbook" he uses are fraudulent in two separate counts:

    • They introduce a physical field into a Logic Exercise that shouldn't touch the physical aspects of the database.

    • But at the same time, the effect they have is that they establish a surrogate, a physical thing, as a logical thing. Thus, they poison the mind.

It's straight science, pure logic, uncontaminated by mad thinking and thus immune to fraud. No surrogates at the logical stage.

1. Relational integrity (which the relational model provides) is clearly different from referential integrity (which is provided by SQL and data writing systems). If you don't understand this, please open a new question "What's the difference ..." and ping me.

2. Violation of any rule always has undesirable consequences other than the act itself.

3. If you don't understand this, please open a new question "What is relational navigation ..." and ping me.

So the final answer to your question is:

All of the items above deal with the primary keys of the relationship, but they are all natural keys, so we can leave them as they are or replace them with surrogate keys.

In the conceptual and logical exercise, we only deal with logical keys. Physical concepts like surrogate are illegal. Replacing the logical key with a physical creature in the Logic exercise is rejected. Use the keys you have that are natural.

Not a "replacement"

There is one more point. The term "replacement" is incorrect. A surrogate never replaces or replaces a natural key.

  • One of the many qualities that a natural key provides is the uniqueness of a row , and this is also required in the relational model, duplicate rows are not allowed.

  • Since the surrogate is not a key to a string (it is a physical pointer to a record), it cannot provide the required string uniqueness. If you don't fully understand what I am talking about, read this answer , from top to False Teachers . Check out the test exercises.

  • Hence, a surrogate, even if considered during the physical modeling phase, is always an optional column and index . It is not a replacement for a natural relational key.

  • Conversely, if the surrogate is implemented as a replacement, the consequence is duplicate rows, a non-relational file, not a relational table.



Case 1

The key attribute is a name, so it must be of type CHAR or VARCHAR. Usually names become key attributes.

Yes.

They are often codes (users do use codes). Often the codes will come out to you (you have a very good example in One More Update ). {D | R | B} will do the same {<| ^ | >}. This is, of course, towards the end of the logical model stage, when the model is stable and one shuts down the keys and optimizes them. At any stage before this, there are wide Natural keys.

The idea is to keep it meaningful.

  • Keys make sense (surrogates don't make sense). One of the qualities of a relational key is that this meaning carries over wherever the key is carried as a foreign key.

  • And according to your example, wherever it is used. Including program code. Record:

     IF CrewType = "Backup"  -- meaningful but fixes a value
     IF CrewType = 1         -- meaningless
    
          

just wrong. Because (a) it is not really Key, and (b) the user can change the value of this database from Backup

to Reserve

, etc. Never write code that accesses a data value, a descriptor. Thus, the fact: Backup

is the projection of the Key, the statement, and the code is the key. This resolves CrewType.Name and Key is CrewTypeCode.

     IF CrewTypeCode = "B"   -- Key, meaningful, not fixed

      

While we're on the keys, note:

  • In the relational model, we have primary keys, alternate keys, and foreign keys (migrated primary keys).

  • We don't have candidate keys, there is no such thing in RM. It is something made outside of RM. Therefore, it is non-relational.

    Even worse, they are used by people who implement surrogates as "primary keys" a .

  • Physical consideration b but which must be understood and applied during the exercise. When the data is understood and known, the columns will be of fixed length. When they are unknown, they can be variables. For Keys, given that they will be indexed, at least on the Primary side, they should never be variables, because this requires unpacking on every access.

and. Using the SQL keyword PRIMARY KEY

doesn't magically turn a surrogate into a PC. Following RM, one (a) identifies possible Keys (no surrogates) and then (b) chooses one as Primary, which (c) means the election is over, so (d) nominated candidates can no longer be called "candidates ", the event is history, so (e) remainder, non-primary keys, are alternate keys.

"Candidate Key" is the rejection of RM compliance and the purpose of the PC, so it itself has nothing to do with relationships. Apart from the fact that they have a surrogate as "primary key" which is the second non-relational item.

b. For those non-technical people who believe that no technical knowledge and foresight, no physical considerations at all should be evaluated during the logical, this penalty, evaluated at the physical level. Since I am not covering the physical here, I am just taking a note for Umbra.

Magicians rely on their tricks to make rabbit bunnies look like lions. They don't need scientists.

Case 2

Two (or more) identifying relationships become the composite primary key of the relationship (which is made from foreign keys).

I think you have the correct idea, but the wording is incorrect for the general case.

  • This statement is correct for an Associative Table that has two foreign keys. Yes, in this case two FKs form a PK, that's all that is needed to make the strings unique. Nothing can improve this. Adding a record ID is redundant.

  • For the general case for any table:

    • Relationship Identification 1 makes the FK (Ported Parent PC) to be part of the PK in the child. Hence name, parent id.

    • This makes the child table dependent 1, which means that child rows can only exist in the context of the parent row. Such tables form intermediate and leaf nodes in data hierarchies, they are the majority of tables in a relational database.

    • If the row can exist independently, the table is Independent 1 . Such tables make up the top of every data hierarchy, very few in a relational database.

    • A Non-identifying relationship 1 is one where the FK (migrated parent PK) is not used to form the child PK.

    • Composite or composite keys simply have more than one column and are standard rates in relational databases. Every table other than the top of every data hierarchy will have a composite key. If you don't have them, the database is not relational.

Please read the IDEF1X Introduction carefully .

1. "Theorists" do not differentiate Identity versus Non-Identifier or Dependent versus Independent: all of their files are independent; all their "relationships" between record pointers are not identified. This is a regression for pre-1970 ISAM record storage systems lacking relational integrity, power, and speed. That's all they understand, that's all they can teach. Fraudulently referred to as "relational".

Case 3

Identifying relationships with weak key attributes also becomes a composite master key.

The term "weak" with or without reference to "key" is not defined in the relational model. This is the fiction of the "theoreticians". Therefore, I cannot answer this question.

  • I note that some of the "theoretical" works contain strong Keys (a normal English word describing the fact that a Key has been installed earlier) as "weak" and weak "Keys" (a normal English word describing the fact that a "key "not previously established) as" strong ". This is the nature of schizophrenia.

  • Therefore, I suspect that this is part and parcel of their proven attempt to confuse science with non-science and undermine the relational model. In the old days, when such people were locked up, humanity was healthy. They now write books and teach in colleges.

Case 4

Associative objects usually have two or more identification relationships

Yes. Two are correct.

If you have more than two, then it is not fully normalized. Codd provides an explicit method to normalize this, so that there will be two (or more) associative objects, out of two exactly identifying relationships.

  • "... therefore all n-ary (more than two) relations ... can be ... and must be solved by binary (two) relations."
    (paraphrased for this context)

to be Junction Tables.

Not. Join and join table relationships are not defined in the relational model, so they are not relational.

Associative entities in logical become associative tables in physical.

Answer Too Long

Answer completion exceeded limit for SO answers. So I put the answer in one document and provided a link. Splitting the answer at this point turned out to be a sin, so the document contains the entire answer with consistent formatting, etc .:

Full answer

  • To continue from that point (i.e. the SO answer text, above), simply scroll down to the heading Case 4 .

  • There is value in keeping the above SO answer text not only for historical purposes but also for text queries, etc.

+5


source


Your list of advantages and disadvantages of using surrogate keys is a good one. As this list shows, this topic is complex. And there is no consensus among database developers about when surrogate keys are specified or contraindicated. Even in this Q&A area, you will find completely different opinions on this matter.

I present your list of "pointless" ones as a disadvantage of using surrogate keys. In many cases, the fact that they are pointless is an advantage, not a disadvantage. In particular, many natural keys invented by humans are not "atomic". That is, they contain several attributes encoded within the key.

For example, it is possible, given the VIN (Vehicle Identification Number) of the vehicle, to determine the passenger seating capacity of the vehicle. But this seating capacity, as originally produced, and not necessarily a seating position at the present time. Since the VIN must be unchanged, it cannot be changed if one spot is ripped out. And now it is misleading.

So many database design teachers defend meaningless keys.



There are several disadvantages of names used as natural keys that you did not mention. They are often not unique and they often change how people use them. For example, a university might have two students named Mary Jones. Or Mary Jones might change her name to Mary Smith, in part after a semester.

There is another drawback that you did not mention. He misrepresented data, including fraud. If the SSN is used to identify employees, we must make sure that the employee gives us a fake SSN and then hires the person who actually owns that SSN. The database is in real life at this point.

This answer only touches on a few aspects of a very large topic. I suggest continuing reading from authors such as CJ Date.

0


source







All Articles