数据库知识整理

1.phpmyadmin we can see all the informations.
2.use + name open a database;
3.show databases;
4.show tables;
5.desc name;
6.where choose the information we need;select *(the datas) from table_name
where name=’ some_name’;
between a and b;search the information;
7.在插入时当使用char varchar 类型的数据时,需要加单引号。
并且在数据插入时,使用’,,,,’,数据将会在一个表格里。
8.update table_name set column_name =’what_name’,
where columnn_name = ‘which_name’;
9.原子性
10.主键
11.在一张已经建好的表里添加自己的信息,比如添加主键
alter table my_contacts add column auto_increment first,
add primary key(contact_id);
id是自己算的,主键是自己指定的。
12.第一范式:数据具有原子性,而且每个数据均具有唯一的识别方法。
13.order by column_name ASC , or colum_name DESC;
14.group by first_name
15.avg,max,min 分组计算表单的值。
16.第二范式:先符合第一范式,并且表中的所有数据与主键都是完全依赖的关系,
就是第二范式。
17.source route;可以将代码写进mysql;