zoukankan      html  css  js  c++  java
  • sql三大范式

    一、第一范式:

    必须有主键,列不可分。

    二、第二范式:

    当一个表是复合主键,非主键的字段不依赖于部分主键,

    例如:

    create table sci(

       sno int(32),cno int(32),grade int(32),credit int(32),

    primary key sno,cno

    )

    非关键字属性credit仅函数依赖于cno,也就是credit部分依赖组合关键字(sno,cno)而不是完全依赖。

    分成两个关系模式 sc1(sno,cno,grade),c2(cno,credit)。

    三、第三范式:

    关系模式R(U,F)中的所有非主属性对任何候选关键字都不存在传递依赖

    例----S1(SNO,SNAME,DNO,   DNAME, LOCATION)

    关键字 SNO 对 LOCATION 函数决定是通过传递依赖 SNO -> LOCATION 实现的。也就是说,SNO不直接决定非主属性LOCATION。

    解决方法:分为两个关系 S(SNO,SNAME,DNO),D(DNO,DNAME,LOCATION)

  • 相关阅读:
    未能加载文件或程序集BUG系列
    寄语
    65. Valid Number
    56. Merge Intervals
    sublime text3 anaconda 插件报错
    42. Trapping Rain Water
    windows 下win+r无效
    93. Restore IP Addresses
    32. Longest Valid Parentheses
    48 Rotate Image
  • 原文地址:https://www.cnblogs.com/John-/p/7128616.html
Copyright © 2011-2022 走看看