摘要:
库表字段约束规范 #这个人是不是vip 字段命名:is_vip,字段必须是小写字母,不能以数字开头,不能出现复数,不能使用关键字,主键索引名一般以pk_xxx形式 类型:unsigned tinyint 长度:1 表名: 主键索引名一般以pk_xxx形式 唯一键索引名uk_xxx 小数禁止使 阅读全文
posted @ 2020-08-03 17:36
leoIOIO
阅读(104)
评论(0)
推荐(0)
摘要:
view视图创建,使用,作用 筛选,防止看到敏感数据 降低SQL复杂度 create view vm_stu as select name,phone from student; #有了视图之后可以直接再navicat中查看,也可以用语句 select * from vm_stu; cr 阅读全文
posted @ 2020-08-03 17:35
leoIOIO
阅读(199)
评论(0)
推荐(0)
摘要:
子查询基本语法 mysql> select * from student; + + + + + + | id | name | gender | age | phone | + + + + + + | 2 | Jack | 1 | 28 | 17777777777 | | 3 | Jerry | 1 阅读全文
posted @ 2020-08-03 17:34
leoIOIO
阅读(76)
评论(0)
推荐(0)
摘要:
union联合查询 mysql> select age,gender from info union select name,phone from teacher; + + + | age | gender | + + + | 25 | 男 | | 23 | 女 | | 26 | 女 | | 23 阅读全文
posted @ 2020-08-03 17:33
leoIOIO
阅读(101)
评论(0)
推荐(0)

浙公网安备 33010602011771号