
MySQL
zwxu_
梦想还是要有了,万一。。。。。
展开
-
sql server和mysql server sql语句对比
sql server /* 1.创建EmployeeInfo(雇员信息)表 */ use myshop if exists(select * from sysobjects where name='EmployeeInfo') return create table EmployeeInfo ( Eid int primary key not null, EName nvarcha原创 2015-08-26 10:03:08 · 795 阅读 · 0 评论 -
关于外键约束
1.MYISAM是不支持外键约束,考虑外键约束,需将engine设置为InnoDB 2.设置外键约束时,如果在order_items添加一条关于orderid的数据,而此时orders对应orderid无此订单数据,会提示cannot add or update a child row; 此时需添加级联更新/删除 ,alter table add constraint fk_1 foreign原创 2015-09-21 15:34:53 · 609 阅读 · 0 评论 -
mysql索引
Mysql常见索引有:主键索引、唯一索引、普通索引、全文索引、组合索引 PRIMARY KEY(主键索引) ALTER TABLE `table_name` ADD PRIMARY KEY ( `column` ) UNIQUE(唯一索引) ALTER TABLE `table_name` ADD UNIQUE (`column`) INDEX(普通索引) ALTER T原创 2016-07-19 21:20:13 · 443 阅读 · 0 评论 -
范式说明和数据库脏读、幻读、不可重复读
1NF:字段不可分; 2NF:有主键,非主键字段依赖主键; 3NF:非主键字段不能相互依赖;原创 2016-10-02 14:22:18 · 343 阅读 · 0 评论 -
SQL注入
发生场景:不合法的输入条件,导致改变sql语句 示例1: 参数为:http';drop table user -- ' sql为select * from apitest_component where 1=1 and protocol_type = 'http';drop table user #'(这里#是注释功能) 影响结果:会删除其他表 示例2: 参数为:http’原创 2017-08-19 08:54:08 · 359 阅读 · 0 评论