卢雨杰1014
学习内容:
数据库
数据库管理系统(DBMS)
安装MYsql
创库:create database school;
用库 use school;
创表 cteate table student;
看表show tables;
看库:show database;
删除表:drop table n;
添加列:alter table student add age int;
修改列:alter table student modify age varchar(10);
修改列名: alter table student change age ages ;
删除列: alter table student drop ages;
重命名表:rename table student to lyj
添加数据:insert into student values(1,'l',22),(2,'y',33),(3,'j',44);
查询数据: select num from student where id=22;
查询所有数据:select * from student
修改数据:
全部修改:update student set num=1;
按条件修改:update set num = 3 where id =33 ;
删除数据:(删除数据一定要加where条件)
**delete 是清空表中的数据 **
truncate 是清空表数据,重新创建一个一样表
删除数据: delete from lyj where num=3;
学习心得:
今天学习了一直很想学习的数据库,接受了一门对我来说完全陌生的知识,消化起来略有难度,感觉不错
点赞
评论留言