General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only