Hi I'm looking to convert part of my oracle sql script into mysql script.
The part that I'm converting is as follows:
create table inspection
(property_no number(5) not null references prop_for_rent(property_no),
staff_no number(5) not null references staff(staff_no),
inspect_date date,
comments varchar2(50),
primary key(property_no,staff_no,inspect_date))
I have started to convert just having difficulty with the primary key which throws an error #1062 - Duplicate entry for primary key when inserting into the db. image link below :
numbertonumericandvarchar2tovarcharit should work: sqlfiddle.com/#!9/fb695einsert into inspection values(1003,201,'12-JUN-2012','Cracked sink in kitchen requires repair'); MySQL said: Documentation #1062 - Duplicate entry '1003-201-0000-00-00' for key 'PRIMARYinsert into inspection values(1001,201,'12-JUN-2010','No problems'); insert into inspection values(1002,201,'13-JUN-2010','Crockery needs to be replaced'); insert into inspection values(1003,201,'12-JUN-2009','Broken window pane requires urgent repair'); insert into inspection values(1006,203,'21-MAR-2010','No problems'); insert into inspection values(1007,203,'01-DEC-2010','Sofa trim pulled apart by cat. Repair needed'); insert into inspection values(1003,201,'12-JUN-2012','Cracked sink in kitchen requires repair');