Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
What is difference betwen connecting tables with primary keys and connecting primary key with non-primary key?
>>Can someone explain to me, how the tables are connecting (primary key with wath, indexes and others) in some database?
>
>Boban,
>In its simple form a primary key connects to any other key expression (foreign key). Primary key constitutes the '1' side and foreign key 'many' side. If you connect 2 primary keys than it'd be 1-to-1.
>Keep in mind that these are 'persistent' definitions for database and you're never limited to those connections. ie: customer.cust_id (PK) connects to orders.cust_id (FK). Here parent is customer and orders is child. However at times (such as reporting) you might well reverse the relation from orders to customer (not persistent).
>If you dont need persistent relations (Referential integrity control) than you might never create them. But IMHO if nothing else they visually help you to see relations between tables in a DBC.
>Cetin
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement