什么是数据库:数据库就是一个文件系统,只不过我们要通过命令(SQL)来操作这个文件系统
数据库是长期储存在计算机内,有组织的,可共享的数据集合。
作用:储存数据,数据的仓库,带有访问权限不同人可以有不同的操作。
常见数据库:
mysql:开源免费的适用于中小型企业的数据库,sun公司收购了mysql,sun公司被oracle收购了,开始收费。
mariadb:由mysql创始人弄出来的,mysql开源版本
oracle:甲骨文公司,商业软件
db2:IBM公司,thinkpad,银行系统
sqlserver:windows里面,政府,大学教育
修改表:student为表名
添加列:alter table student add chengji int not null
修改列:alter table student modify sex varchar(2)
修改列名:alter table student change sex gender varchar(2)
修改表名:rename table student to heima
修改表的字符集:alter table heima character set gbk;
查看数据库中所有表:show tables;
查看表结构:desc student;