• Creator
  • #2210867

    Table Design


    by ather rehan ·

    I have a table Practice(Doctor) which has some following entities…
    practice_id(doctor_id), name, address, gender. Practice_id(doctor_id) is primary key. Now I want to alter table to add a new column specialization.But when I query………

    ALTER TABLE Practice ADD specialization char(12)

    The error occurs. I knows that the error occurs because of PRIMARY KEY attribute of practice_id(doctor_id).
    Now,the one and fool way is that first I drop the PRIMARY KEY constraint, then I TRUNCATE the table and then at last ADD specialization column(entity).
    This way is not well to follow. Now please guide me how I add an entity [specialization] without doing this above foolish job.

All Answers

  • Author
Viewing 0 reply threads