Is there a difference between Surrogate key, Synthetic Key, and Artificial Key?

Surrogate key, synthetic key and artificial key are synonyms. Technical key is another one. They all mean “primary key which doesn’t have a business meaning”. They are distinct from natural or business keys which have a meaning beyond the system at hand. For instance, consider the SO user account. We are identified by two keys. … Read more

how to pass a null value to a foreign key field?

Just allow column university_id of table user to allow NULL value so you can save nulls. CREATE TABLE user ( uid INT NOT NULL, Name VARCHAR(30) NOT NULL, university_ID INT NULL, — <<== this will allow field to accept NULL CONSTRAINT user_fk FOREIGN KEY (university_ID) REFERENCES university(university_ID) ) UPDATE 1 based on your comment, you … Read more