关系型数据库 :MySQL,Oracle,Sql Server,DB2, SQLite
非关系型数据库: Redis,MongDB
NOSQL not only sql
DBMS 数据库管理系统: 数据库管理软件,科学有效的管理数据 MySQL 其实是个数据库管理系统 属于Oracle 最早是瑞典的公司开发的 开源 适用于中小型网站 也可以适用大型的(数据库集群)
1安装MySQL 尽量不适用exe 卸载麻烦
2.尽量使用压缩包 安装简单些。
操作数据库, 操作数据库的表 操作数据库表中的字段
create database if not exists westos
drop database if exists westos 数据库的表明 字段名有 特殊字 要用那个点···· tab键上面那个点
drop 删除
show databases 查看数据库
一 列的数据类型
数值 tinyint 一个字节smallint较小字节 int 四个字节 bigint八个字节
float 4个字节 double 8个字节 decimal 字符串类型的浮点数, 金融计算时
字符串 char 比较小的0--255 vachar 可变字符串 0-65535 大小
时间日期 :date , time , datetime最常用 timestamp 时间戳(1970.1.1到现在的毫秒数) year
null
二 数据库的字段属性(重点) 自增,zerofill null
建一张表 alibaba 要求 有 id,version,is_delete,gmt_time,gmt_update 这五个字段
create table if not exists `student`(
`id` int(4) not null auto_increment comment
)