关系型数据库
是有多张相互连接的二维表(行,列)组成的数据库
非关系型数据库
不是用通过表来存储数据的是非关系型数据库
MySQL
启动mysql:net start mysql 结束mysql;net stop mysql
服务器:安装了某一个服务其软件的计算机,可以提供服务,提供你想要的东西 登陆服务器:mysql -uroot -p 退出:exit或quit
SQL语言:所有关系型数据库的统一标准
可以创建多个数据库,一个数据可中可以存储多张表,一张表中可以存储多条数据
SQL语句语法

分类
DDL:操作数据库,表等 DML:对表中的数据进行增删改 DQL:对表中的数据进行查询 DCL:对数据库进行权限控制
操作数据库

操作表
一、创建表  二、查询表  三、修改表  四、删除表 
数据库数据类型
数据库数据类型大概分为三种:数值,日期,字符串 数值常用:int,double(总长度,小数点后保留的位数) 日期常用:date 字符串常用:char(最长字符数),varchar(最长字符数)
操纵表中的数据
一、添加数据  二、修改数据  三、删除数据  四、查询数据
-
基础查询  -
条件查询  注:在sql语句中,日期也是可以用大小来比较的 -
排序查询  聚合函数:  注:count(取值):主键或者* -
分组查询  -
分页查询 
约束
定义::约束的是作用于表中列上的规则,用于限制加入表的数据 作用:约束的存在保证了数据库中数据的正确性,有效性和完整性 分类:  注: MySQL不支持检查约束 自增:auto increment
操作约束 直接在创建表的字段后面添加约束或者 
|