Greetings, i just want to ask how to insert a data with fk. Like if i insert a data on tblPatient, the patientID will be displayed on the tblRecord.

is it just a normal insert into tblpatient or is there another code for it?



You would run your insert on your table as normal passing the foreign key in as a value. For instance, to use your patient example, I want to record a visit by a patient with an ID of 1 to the doctor with an id of 2...
INSERT INTO tblVisits(VisitDate, patientID, doctorID, cost) Values('2014-01-27 14:30', 1, 2, 56.66)
Assuming there is also a tblDoctors, you have just inserted 2 foreign keys into the Visits table, patientID and doctorID, of course, you would have to have a doctor with an ID of 2 and a patient with an ID of 1...