can i consider 3 columns of a single table together as a composite primary key.... & wat if i want to refer just 1 column out of that in some other table as a foreign key....is it possible....plzzz reply as soon as possible...thank u..
yes you can put 3 columns as primary key, also you can put one of them as foreign key.
Yes, on both accounts. 3 columns can be used as a composite key and 1 of those could be used as a foreign key.
Foreign keys must reference a set of columns over which a unique constraint is defined (SQL 2008 standard 11.8: Syntax Rules: 3.a). A single attribute of a composite primary key does not necessarily have a unique constraint defined.
If the single attribute does have a unique constraint defined, that most likely indicates bad design -- the primary key's unique constraint would be redundant.
With that in mind, I would say that "no" is the correct answer to your question, although I suppose technically it may be possible in some situations that I doubt apply in your case.