Question:
Can a primary key contain more than one columns?
Answer:
Yes Source: CoolInterview.com
primary key not allow null values,unique key allow only one null value.In table only one primary is allowed,unique key as many as it can allow. Source: CoolInterview.com
Answered by: sravan | Date: 1/8/2008
| Contact sravan
In each table each column it can allow only one primary key the same table more than one primary key then it is called composite primary key Source: CoolInterview.com
Answered by: sravan | Date: 5/13/2008
| Contact sravan
yes a primary key can have more than one columns through candidate key Source: CoolInterview.com
Answered by: pavan | Date: 8/13/2008
| Contact pavan
Yes.A PRIMARY KEY can contain more than one column and this type of primary key is known as composite primary key. Source: CoolInterview.com
Answered by: Samir Kumar Sahoo | Date: 1/23/2009
| Contact Samir Kumar Sahoo
yes.. A PRIMARY KEY is meant for one column.. If a PRIMARY KEY is defined on more than one column then it is called COMPOSITE PRIMARY KEY.. if you have a table having course id and student id where as one student can apply for many courses and in such a way you can define PRIMARY KEY on both columns like COURSEID AND STUDENTID. Source: CoolInterview.com
Answered by: uday bhasker | Date: 4/21/2009
| Contact uday bhasker
yes a primary key can have more than one column.its called a composite primary key but no table can have more than one primary key. Source: CoolInterview.com
Answered by: purnima | Date: 5/2/2009
| Contact purnima
if the same data appears in more than one row for a particular column.( eg: last name of 2 sons of the same family) here p'key:last name is useless
In that case, primary key can have more than one column. (p'key:last name and first name) Source: CoolInterview.com
Answered by: madan | Date: 6/22/2009
| Contact madan
Yes. Multiple column are aloud in primary key it is known as composite primary key.primary key does not allow null values. it is unique key which is used to search data from table. Source: CoolInterview.com
Answered by: Shaikh Rehana | Date: 2/2/2010
| Contact Shaikh Rehana
Yes.
Primary key contain more than one columns. This primary key is called as Composite Primary Key. Source: CoolInterview.com
Answered by: BETHE | Date: 3/12/2010
| Contact BETHE
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|