Does having a primary key column mean there is an index on that column? If so, what kind of index is it?
It depends on the database.
Some databases either require or automatically create primary key indexes as a way to enforce the uniqueness of a primary key. Others are perfectly happy to perform a full scan of the table.
Which database are you using?
EDIT:
- SQLServer (versions 7 - 2008) creates indexes or primary keys - you can control whether or not it is clustered.
- Older versions of Oracle (8i,9i) also create indexes when you add a unique key constraint. Newer versions (10g) don't seem to, based on the test case I just looked at.
Please check on this article
http://stackoverflow.com/questions/462477/sql-primary-key-and-index
In any "real" database, yes having a primary key means having a unique index. In some databases, the primary key index can/will cluster on key values too.
Yes, a primary key implies an index.
If the primary key is clustered, the index will be part of the main table file. It it's not clustered, it will be part of a separate index file.
In all the DBs I've used, PRIMARY KEY is basically just a UNIQUE index.
For SQL Server, which I believe from previous questions is what you're using, when you define a PRIMARY KEY, it will automatically have a index on that column which will default to being a CLUSTERED index. You can define whether it should be a NONCLUSTERED or a CLUSTERED index when you create the constraint.