Primary Key/Foreign Key Question
I need some clarification on my thinking on primary/foreign keys. Are they strictly used for data integrity ? By implemnting them on a series of tables, wil my data be returned quicker, or does that depend on how the sql is written. Example would be table1 has a column say called SSN. I then have two other tables, each with an SSN columns in them. i put a primary key on table1 and a foreign key on tables 2-3. That ensures my data integrity I assume ?
If i write some sql like (just a simple example)
select
t1,ssn,
t2,name,
0