Difference between revisions of "Mysql setting constraints"

From MyWiki
Jump to: navigation, search
Line 8: Line 8:
 
     REFERENCES Institution (institution_id)
 
     REFERENCES Institution (institution_id)
 
     ON DELETE CASCADE ON UPDATE CASCADE,
 
     ON DELETE CASCADE ON UPDATE CASCADE,
 +
 +
 +
create table notes
 +
(
 +
hostname varchar(30),
 +
notes varchar(100),
 +
constraint my_1
 +
FOREIGN_KEY hostname
 +
REFERENCES sslhosts (hostname)
 +
ON DELETE CASCADE ON UPDATE CASCADE
 +
);
 +
 
</source>
 
</source>
 
http://www.mysqltutorial.org/mysql-primary-key/<br>
 
http://www.mysqltutorial.org/mysql-primary-key/<br>

Revision as of 12:09, 22 January 2019

  CONSTRAINT education_ibfk_1
    FOREIGN KEY (profile_id)
    REFERENCES Profile (profile_id)
    ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT education_ibfk_2
    FOREIGN KEY (institution_id)
    REFERENCES Institution (institution_id)
    ON DELETE CASCADE ON UPDATE CASCADE,
 
 
CREATE TABLE notes
(
hostname VARCHAR(30),
notes VARCHAR(100),
CONSTRAINT my_1
FOREIGN_KEY hostname
REFERENCES sslhosts (hostname)
ON DELETE CASCADE ON UPDATE CASCADE
);

http://www.mysqltutorial.org/mysql-primary-key/