Referential Integrity Constraints is the attributes in one relation (table) referring to attributes of another relation(table), which should be primary key of the referential relation(table).
The attributes, which references primary key of another relation(table) as referential foreign key, is either null or exists in the referential relation(table). Also, the attributes being referenced in the relation(table) is the primary key.专业号 is referential foreign key in 学生 relation(table), but 专业号 is the primary key being referenced in 专业 relation(table).

解决方案 »

  1.   

    这样:
    对于学生表来说,主键(PK)是学号,外键(FK)是专业号,专业表是被参照关系而对于专业表来说,主键是专业号,外键是学号。
    这样说可能比较容易理解:
    比如,你现在知道一个学生的姓名,你想知道他学的是什么专业,怎么办?专业号是连接这两个表的桥梁,通过查询可以知道他学的是什么专业。因为在专业表中专业号是主键,每个专业号必然对应着一个专业名。
    同样,你也可以知道某个专业有那些人选修。