MySQL Index

I have inherited a database with data missing from Key columns

I want to create a unique index to prevent duplicates, the problem is above

Example
I want 5 non null columns
Cname, Sname, Add_1, DOB, CountyID

There is null values in the DOB column, is there a way of creating an index on these columns from this point on? or do I need to populate the DOB (Date) column before I can create and index.
BrogrimInformation Systems Development ManagerAsked:
Who is Participating?
 
rjohnsonjrCommented:
You can create an index on a column with null values.

If you create one big index using all those columns you may run the risk of duplicates though if you have null values.  

If there is an issue an error will show and the index will not be created.

If there is a ton of data you may want to do this after hours as index creation can take awhile.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.