Tag Archives: SQL102

Referential Integrity

OK, I’ve talked about Primary Keys and Foreign Keys.  Now let’s talk about Referential Integrity.  Basically this just means that any Foreign Key value in one table has to have that same value defined in the table where that Foreign Key is the Primary Key.  Let’s look at two tables, and try to explain this [...]

 

Comments ( 1 )

SQL 102 – Indexes With Included Columns

  I’ve shown you how to create indexes, CLUSTERED versus NONCLUSTERED indexes, today I want to build on that. Let’s say you have a lookup query that takes names, and returns an ID for that name, you can actually build your query in a way where it would look up that data using just an [...]

 

Comments ( 0 )

SQL 102 – UNIQUE INDEX

Ok, you understand how to create an INDEX.  You understand the differences in CLUSTERED and NONCLUSTERED indexes.  Did you know you could index a view? You can.  But before you start adding indexes, just like you would for a table, you’ll have to create an UNIQUE CLUSTERED INDEX on that index.   The reason for that [...]

Comments ( 0 )