0

Hi
I m thinking about combined key system. say i have mysql table having field
1. user_name
2. father_name
3. mother_name
4. Address

Now I can mark user_name field as key for unique value.
But I dont want that. I want that same user name is possible but same user name, father name and mother name combine is not possible. combined they must unique. mor easily

1. name01, father01,mother01
2. name01, father01,mother02
3. name01, father02,mother01
above data entry may be allow
But I want that
1. name01, father01,mother01
2. name01, father01,mother01
above data entry will not be allowed

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by hielo
0

CREATE TABLE student(
name CHAR(100),
father CHAR(100),
mother CHAR(100),
address VARCHAR(255),
PRIMARY KEY (name,father,mother)
)

0

CREATE TABLE student(
name CHAR(100),
father CHAR(100),
mother CHAR(100),
address VARCHAR(255),
PRIMARY KEY (name,father,mother)
)

thanks it works for me. now how can edit primary key. another question field has been set unique wrongly. how can I ununique now.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.