SQL笔记

1、 创建新文件
– 编译mysql,点击‘+’号,data source→mysql
– user:xxxx, password:xxxxxx,test connection
– 右键new→schema(如test)
– 右键test,new→query console
2、运行
1)
在这里插入图片描述
这是选中那部分执行那部分。
2)

3、知识点
1)DATABASE表示数据库,数据库里面有很多数据表table
2) VARCHAR加双引号
3)Incorrect string value: ‘\xE7\xA8\x8B\xE5\xBA\x8F…’ for column ‘字段名’ at row 1 问题的解决方法
表后加上“ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8mb4;”
4)
insert ignore into:若没有则插入,若存在则忽略
replace into:若没有则正常插入,若存在则先删除后插入
insert into … on duplicate key update:若没有则正常插入,若存在则更新

参考:
https://blog.csdn.net/fckbb/article/details/131034688
https://zhuanlan.zhihu.com/p/530311180
https://blog.csdn.net/heyianliunian/article/details/125990986
https://blog.csdn.net/qq_61777435/article/details/130619296
https://zhuanlan.zhihu.com/p/372133621

你可能感兴趣的:(sql,笔记,数据库)