Tables for doctor and patients
The CONSTRAINT word used within a CREATE TABLE or ALTER TABLE tells MySQL engine that this value is not a separate column, but rather it is applied on a column within the table. 

The FOREIGN KEY word tells MySQL that whatever is in that field must reference a valid PRIMARY KEY from the other table on INSERT or UPDATE record, otherwise an error is raised. 

CONSTRAINT FOREIGN KEY is simply how you phrase it. For more information I suggest reading up about it in the manual. 

Now for your criteria:


A patient must have a name: FALSE

That one is not true, unless you added either of those two to your CREATE TABLE PATIENT


NOT NULL to the userID column and a CONSTRAINT FOREIGN KEY (userID) REFERENCES USER(userID)
or, preferably in my opinion:
nameID MEDIUMINT NOT NULL, CONSTRAINT FOREIGN KEY(nameID) REFERENCES NAME(nameID),

A patient can be a user: TRUE
A doctor must have a name: TRUE
A doctor must be a user: TRUE
A patient can be a doctor and vice versa...: TRUE (via userID)
By 3 &amp; 5, if a patient is a doctor that patient must be a user: TRUE