The fresh new element one forges the partnership between a few tables is the “secret
For schedules and you may times, there’s only one solutions: this new Time/Time investigation type of. Make use of this for simple dates (1/), effortless times (5:forty five PM), and you will real big date/minutes (1/ 5:45 PM). Discover “Schedules! Schedules! Dates!” during the Chapter 7.
not, if you may prefer to add one or more a lot more viewpoints afterwards (such as Do not know), explore Text message rather
To have foreign secrets, you need to use the analysis types of the newest priple, if your first trick is an AutoNumber, use the Count study sort of for the Job Size set-to Long Integer into the international key. (See “Relationship Angst” for additional information on primary and you will overseas tactics.)
To see exactly how techniques are used to create matchmaking, consider several dining tables: that list customers together with most other listing instructions
Particular databases experts recommend using a meaningful field instead of an enthusiastic AutoNumber ID as an initial secret. That’s because if you use a keen AutoNumber since your prie record multiple times-the only difference in the fresh details was the ID quantity. And you will duplicate info produce all sorts of stresses.
If you do have fun with some thing significant-including the buyers label otherwise personnel ID-due to the fact good prie list twice by the book list which is enforced into the number one secret. You could come upon more issues with using important sphere. Such as, several consumers could have an identical title, or you could need to incorporate you to definitely the employees desk whom doesn’t yet keeps a member of staff ID. As well as having an important trick, you could nonetheless go into duplicate info in the event the, including, you employ a slightly other spelling of your own name.
For these reasons, we advice using a keen AutoNumber ID profession normally. It is effortless, it’s easy, also it works.
” It’s such as for instance a personal Protection number-a separate identifier for each list where dining table. A table framework necessitates that all the dining table possess one career one to acts as a separate secret. I label which an important secret career. For the Supply, your specify it because of the proper-clicking the field from inside the Build Take a look at and you can shopping for “Number one Secret.”
End up being vewy, vewy careful when you choose the no. 1 trick job-their worth have to be unique for each checklist. You believe gratis app incontri etero your businessName profession during the a customers desk tends to make an effective top key, but it probably will not. (After all, you’ll have a couple people with the same business title for the various other states.) The easiest approach should be to include an “ID” profession to each table (into consumers desk, we shall call-it “customerId”) and use the AutoNumber data style of for the profession. Every time you include a new number with the consumers table, Supply will get into an alternative, unique matter towards the that record’s customerId career. The wide variety is worthless-they simply act as book identifiers. (See the sidebar “Top Tactics and you may Backup Information” getting greater applying for grants ID areas.)
Once we spotted in the last Annoyance, new commands table ought not to have any customer guidance inside it (like shipments target, providers label, etc), once the that’s it recyclable advice you do not need to retype on per buy. Exactly how do you carry out a report that songs hence acquisition goes with and that consumer, and you can gift ideas all of that information on one display screen? You merely create a field to the sales table that relates towards no. 1 key of the customers table. You age, customerId (discover Shape step 3-5). It’s simple to realise why it is crucial the no. 1 key getting book. Every purchase throughout the orders dining table have a customerId, which is the only method you will understand which customers brand new order is part of. By the way, new customerId profession from the commands dining table is called a great foreign secret ; it is the value of a first trick community within the another table.
دیدگاهتان را بنویسید