zzyzjmysql0406

这是一个自创的简易MySQL包

Usage no npm install needed!

<script type="module">
  import zzyzjmysql0406 from 'https://cdn.skypack.dev/zzyzjmysql0406';
</script>

README

qd67 39dxuk7h

git 代码: 暂存区 git init 初始化 git status 查看状态 git add . 添加所有文件 git add 文件名 添加指定文件 git restore 恢复 git diff 查看修改内容

   git仓库
   git commit -m"记录说明"                   提交记录
   git log                                  查看记录
   git log --oneline 查看简略记录
   git reset --hard 某条记录hash(哈希)值     回滚到该记录
   git reset --hard 说明:                   不加--hard 回滚但是代码不恢复; 加--hard 回滚但是代码也恢复

   git reset --hard HEAD^^^                 恢复到上一次记录 多少个^符号就往上多少次
   git reflog 查看历史记录

   远程仓库
   建立远程接连  git  remote add origin 远程仓库地址
   发送到远程仓库  git push -u origin master
   查看分支   git branch
   创建分支      git  branch  分支名
   切换分支     git  checkout  分支名
   创建分支并克隆远程分支到本地 git checkout -b 创建分支名 origin/远程分支名
   合并分支 git merge 分支名
   删除分支   git branch  -d 分支名
   删除远程分支   git  push origin -delete 分支名

MYSQL -- 注释,一定不要遗漏这个空格

-- 1.插入数据(增) -- 语法: insert into 表名(字段名 1,字段名 2) values('值 1','值 2') insert into user(name,age,description) values('任贤齐','30','心太软好男人'); insert into user(name,age,description) values('陈小春','35','山口组女婿'); insert into user(name,age,description) values('陈浩南','36','铜锣湾扛把子');

-- 2.删除 -- 语法:delete from 表名 where 条件 -- 2.1 下面这条语句慎用,他会删除掉表的所有数据. -- delete from user -- 2.2 删除带条件 delete from user where age >= 30

-- 3.改 -- 语法: update 表名 set 字段名 1='新值',字段名 2='新值' where 条件 -- 3.1 下面这条语句慎用,他会更改表中的所有数据. -- update user set name='正宇',age='18',description='班长' -- 3.2 更改带条件 update user set name='小芳芳',age=28 where id=6

--4.查-得到查询的结果集 -- 语法: select _ from 表名 select _ from user select id,name from user select * from user where age >= 30 select id,name from user where age >= 30

-- sql 补充 -- 1.模糊查询 -- 1.1 以什么开头 select _ from hero_recycle where heroName like '女%' -- 1.2 以什么结尾 select _ from hero_recycle where heroName like '%神' -- 1.3 包含 select * from hero_recycle where heroName like '%神%'

-- 2.并且 and select * from hero_recycle where heroName like '%神%' and heroSkill like '%枪%'

-- 3.或者 or select * from hero_recycle where heroName like '%神%' or heroSkill like '%枪%'

-- 4.连表查询 select * from horder inner join customer
on horder.cid = customer.id

-- 给表名取别名 select * from horder h inner join customer c on h.cid = c.id

-- 查询也是可以取某些字段 select h.id,h.oname,h.price,h.cid,c.cname,c.age from horder h inner join customer c on h.cid = c.id

-- 5.分页查询. -- 第一个参数是从第几个开始, 第二个参数是个数 select _ from hero_recycle limit 0,10 select _ from hero_recycle limit 10,10 select * from hero_recycle limit 20,10

-- 6.排序 -- 关键字是 order by -- desc 是降序 asc 是升序 select * from hero_recycle order by id asc -->