32:
490:
238:
An example of the practical use of an associative table would be to assign permissions to users. There can be multiple users, and each user can be assigned zero or more permissions. Individual permissions may be granted to one or more users.
135:
As mentioned above, associative entities are implemented in a database structure using associative tables, which are tables that can contain references to columns from the same or different database tables within the same database.
155:(FK), each in a many-to-one relationship from the junction table to the individual data tables. The PK of the associative table is typically composed of the FK columns themselves.
140:
61:
489:
792:
124:
743:
83:
702:
Using foreign keys, the database will automatically dereference the values of the UserPermissions table to their own tables.
105:
548:
into a junction table involves multiple steps: first inserting into the main table(s), then updating the junction table.
139:
44:
54:
48:
40:
711:
113:
65:
716:
797:
739:
769:
101:
20:
147:
An associative (or junction) table maps two or more tables together by referencing the
786:
753:
545:
498:
108:
theory. A relational database requires the implementation of a base relation (or
223:
152:
148:
123:
721:
502:
493:
A visual depiction of the table schema described, with relationships indicated
128:
109:
116:. A base relation representing this kind of entity is called, informally, an
774:
757:
219:
158:
Associative tables are colloquially known under many names, including
19:"Crosswalk table" redirects here. For multi-database relations, see
734:
Hoffer, Jeffrey A.; Prescott, Mary B.; McFadden, Fred R. (2004).
25:
542:
This will return a list of all users and their permissions.
488:
151:(PK) of each data table. In effect, it contains a number of
138:
758:"A Relational Model of Data for Large Shared Data Banks"
16:Term in relational and entity–relationship theory
501:-statement on a junction table usually involves
53:but its sources remain unclear because it lacks
8:
649:'A key used for several permissions'
222:—not to be confused with the correct use of
773:
84:Learn how and when to remove this message
505:the main table with the junction table:
122:
7:
14:
655:-- Finally, updating the junction
30:
738:(7th ed.). Prentice Hall.
388:-- This is the junction table.
1:
127:An associative entity (using
610:-- Creating a new Permission
224:pivot table in spreadsheets
814:
736:Modern Database Management
143:Concept of a mapping table
114:many-to-many relationships
18:
793:Entity–relationship model
762:Communications of the ACM
712:Many-to-many (data model)
598:'SecretPassword'
550:
507:
241:
234:Using associative tables
218:(as used incorrectly in
39:This article includes a
68:more precise citations.
553:-- Creating a new User
494:
144:
132:
775:10.1145/362384.362685
631:PermissionDescription
492:
364:PermissionDescription
200:many-to-many resolver
168:cross-reference table
142:
126:
768:(6). ACM: 377–387.
717:Relational database
106:entity–relationship
688:'SomeUser'
604:'UserName'
592:'SomeUser'
495:
180:intersection table
176:intermediary table
145:
133:
100:is a term used in
98:associative entity
41:list of references
160:association table
118:associative table
94:
93:
86:
805:
779:
777:
749:
698:
695:
694:'TheKey'
692:
689:
686:
683:
680:
677:
674:
671:
668:
665:
662:
659:
656:
653:
650:
647:
644:
643:'TheKey'
641:
638:
635:
632:
629:
626:
623:
620:
617:
614:
611:
608:
605:
602:
599:
596:
593:
590:
587:
584:
581:
578:
575:
572:
569:
566:
563:
560:
557:
554:
538:
535:
532:
529:
526:
523:
520:
517:
514:
511:
485:
482:
479:
476:
473:
470:
467:
464:
461:
458:
455:
452:
449:
446:
443:
440:
437:
434:
431:
428:
425:
422:
419:
416:
413:
410:
407:
404:
401:
398:
395:
392:
389:
386:
383:
380:
377:
374:
371:
368:
365:
362:
359:
356:
353:
350:
347:
344:
341:
338:
335:
332:
329:
326:
323:
320:
317:
314:
311:
308:
305:
302:
299:
296:
293:
290:
287:
284:
281:
278:
275:
272:
269:
266:
263:
260:
257:
254:
251:
248:
245:
228:transition table
89:
82:
78:
75:
69:
64:this article by
55:inline citations
34:
33:
26:
21:Schema crosswalk
813:
812:
808:
807:
806:
804:
803:
802:
783:
782:
752:
746:
733:
730:
708:
700:
699:
696:
693:
690:
687:
684:
681:
678:
675:
672:
669:
666:
664:UserPermissions
663:
660:
657:
654:
651:
648:
645:
642:
639:
636:
633:
630:
627:
624:
621:
618:
615:
612:
609:
606:
603:
600:
597:
594:
591:
588:
585:
582:
579:
576:
573:
570:
567:
564:
561:
558:
555:
552:
540:
539:
536:
533:
530:
527:
525:UserPermissions
524:
521:
518:
515:
512:
509:
487:
486:
483:
480:
477:
474:
471:
468:
465:
462:
459:
456:
453:
450:
447:
444:
441:
438:
435:
432:
429:
426:
423:
420:
417:
414:
411:
408:
405:
402:
399:
397:UserPermissions
396:
393:
390:
387:
384:
381:
378:
375:
372:
369:
366:
363:
360:
357:
354:
351:
348:
345:
342:
339:
336:
333:
330:
327:
324:
321:
318:
315:
312:
309:
306:
303:
300:
297:
294:
291:
288:
285:
282:
279:
276:
273:
270:
267:
264:
261:
258:
255:
252:
249:
246:
243:
236:
90:
79:
73:
70:
59:
45:related reading
35:
31:
24:
17:
12:
11:
5:
811:
809:
801:
800:
795:
785:
784:
781:
780:
750:
745:978-0131453203
744:
729:
726:
725:
724:
719:
714:
707:
704:
551:
508:
242:
235:
232:
188:junction table
92:
91:
49:external links
38:
36:
29:
15:
13:
10:
9:
6:
4:
3:
2:
810:
799:
796:
794:
791:
790:
788:
776:
771:
767:
763:
759:
755:
751:
747:
741:
737:
732:
731:
727:
723:
720:
718:
715:
713:
710:
709:
705:
703:
676:PermissionKey
625:PermissionKey
549:
547:
543:
506:
504:
500:
491:
478:PermissionKey
457:PermissionKey
433:PermissionKey
340:PermissionKey
240:
233:
231:
229:
225:
221:
217:
213:
212:pairing table
209:
208:mapping table
205:
201:
197:
196:linking table
193:
189:
185:
181:
177:
173:
169:
165:
161:
156:
154:
150:
141:
137:
130:
125:
121:
119:
115:
112:) to resolve
111:
107:
103:
99:
88:
85:
77:
67:
63:
57:
56:
50:
46:
42:
37:
28:
27:
22:
765:
761:
735:
701:
574:UserPassword
544:
541:
496:
280:UserPassword
237:
227:
215:
211:
207:
203:
199:
195:
191:
187:
183:
179:
175:
171:
167:
164:bridge table
163:
159:
157:
153:foreign keys
149:primary keys
146:
134:
117:
97:
95:
80:
71:
60:Please help
52:
754:Codd, E. F.
619:Permissions
451:Permissions
334:Permissions
216:pivot table
66:introducing
787:Categories
728:References
722:Unique key
448:REFERENCES
418:REFERENCES
192:link table
184:join table
110:base table
102:relational
670:UserLogin
568:UserLogin
546:Inserting
534:UserLogin
472:UserLogin
427:UserLogin
403:UserLogin
256:UserLogin
204:map table
172:crosswalk
131:notation)
798:Diagrams
756:(1970).
706:See also
580:UserName
304:UserName
74:May 2018
503:joining
463:PRIMARY
436:varchar
406:varchar
367:varchar
355:PRIMARY
343:varchar
307:varchar
283:varchar
271:PRIMARY
259:varchar
226:), or
220:Laravel
62:improve
742:
682:VALUES
658:INSERT
637:VALUES
613:INSERT
586:VALUES
556:INSERT
510:SELECT
499:SELECT
391:CREATE
328:CREATE
244:CREATE
562:Users
528:USING
519:Users
421:Users
394:TABLE
331:TABLE
250:Users
247:TABLE
47:, or
740:ISBN
661:INTO
616:INTO
559:INTO
522:JOIN
516:FROM
382:NULL
322:NULL
298:NULL
129:Chen
104:and
770:doi
466:KEY
379:NOT
373:500
358:KEY
319:NOT
295:NOT
274:KEY
120:.
96:An
789::
766:13
764:.
760:.
697:);
652:);
607:);
537:);
497:A
484:);
460:),
442:50
430:),
412:50
385:);
349:50
325:);
313:50
289:50
265:50
230:.
214:,
210:,
206:,
202:,
198:,
194:,
190:,
186:,
182:,
178:,
174:,
170:,
166:,
162:,
51:,
43:,
778:.
772::
748:.
691:,
685:(
679:)
673:,
667:(
646:,
640:(
634:)
628:,
622:(
601:,
595:,
589:(
583:)
577:,
571:,
565:(
531:(
513:*
481:)
475:,
469:(
454:(
445:)
439:(
424:(
415:)
409:(
400:(
376:)
370:(
361:,
352:)
346:(
337:(
316:)
310:(
301:,
292:)
286:(
277:,
268:)
262:(
253:(
87:)
81:(
76:)
72:(
58:.
23:.
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.