• mysql记录(一)


    (1)修改数据库中的字段名称
    alter table student MODIFY COLUMN direction varchar(20);
    (2)删除表中的一列字段
    alter table studio drop studio_flag;
    (3)添加字段
    alter table studio add studio_version varchar(50);
    (4)设计表时注意:
    <1>主键有具体含义时尽量不要直接命名为id
    <2>学号等可能以0开头的数据不要设计为int型,varchar类型
    例如:04143114,如果为int型,则java存入mysql时会自动舍去0
    <3>Error Code: 1175. You are using safe update
    这是因为MySql运行在safe-updates模式下,该模式会导致非主键条件下无法执行update或者delete命令,执行命令SET SQL_SAFE_UPDATES = 0;修改下数据库模式
    <4>设置字段的唯一性

    未完待续

  • 相关阅读:
    hashlib模块
    logging模块
    Python的富比较方法
    格式化符号说明
    __str__与__repr__区别
    2014-07-18&nbsp;10:25

    2014-07-17&nbsp;17:04
    2014-07-17&nbsp;16:44
    2014-07-16&nbsp;15:54
  • 原文地址:https://www.cnblogs.com/wangxiaopei/p/8551265.html
Copyright © 2020-2023  润新知