title: How to alter the properties of the Primary Key in a column
body: <p>Im trying to alter a table named Artist(id,name), with id as its Primary Key, so as to match with another table Song(title, artist_id, year). The column artist_id is a Foreign Key.
  The column artist_id was NOT set to be null when deleted, so i altered it using this query:</p>
  
  <p>ALTER TABLE Song ADD CONSTRAINT FK_song_4 FOREIGN KEY (artist_id) REFERENCES Artist(id)  ON DELETE SET NULL;</p>
  
  <p>I am trying to implement the same alteration on Artist as well (to set its Primary Key null on delete, so as to be able to insert more values to one of those tables, but the exact same syntax is not correct in order to alter the Primary Key) but MySQL Workbench points out a syntax error.</p>
  
  <p>Summing up, my problem is:
  how to set a Primary Key null on delete</p>
  
  <p>Here is my code:</p>
  
  <pre><code>alter table Song add constraint FK_tragoudi_3 foreign key (artist_id) references Artist(id)  ON DELETE set null ;
  
  alter table Artist add constraint PK_artist_1 primary key (id) on delete set null;
  
  SET @titl="Beat it";
  SET @composer ="122";
  SET @year= 1990;
  SET @song_writ="211";
  
  insert into Song (title, composer, year, song_writer) values (@titl, @compose, @yearr, @song_writ);
  insert into Artist (id, name, surname, year) values (@composer, "George", "Smith", 1960);
  </code></pre>