I have a table "Student". This table has three fields- SNo, SName and SClass.
While creating this table, these three fields are set to have primary keys.
Now I want to split the field SName into SFirstName and SLastName.So I add two new fields - SFirstName and SLastName to the "Student" table.When I try to insert new values into the Student table, it displays the error message "Null value cannot be inserted into the SName" and fails to create a new record after adding two new fields.
I am assuming that SName has the primary key, so it does not allow to create a new record as this field cannot be null. Could anyone tell me how I can drop the primary key constraint on this SName field so that I can create a new record by inserting new values in all the fields - SNo,SFirstName,SLastName and SClass except the SName field without displaying the error message: "Null value cannot be inserted into the SName".
SName and Sclass are just an example fields.
I also need some advice for the data conversion process:
I thought of writing the update statement as follows:
update Student set SFirstName = 'A',SLastName='B' and SClass=1 where SName='AB' and SClass=1;
Could anyone tell me whether this is the correct procedure to do the data conversion.
If the SName has 17 values and Sclass has 2 values then do we need to write 17*2 =34 update statements for the data conversion process.