Blogger Information
Blog 20
fans 0
comment 0
visits 12345
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
总结mysql 常用DDL, DML语言并实操;
缘亦
Original
476 people have browsed it

1. 总结mysql 常用DDL, DML语言并实操;

  • MYSQL就是一种用来储存数据的库,DDL, DML语言则是对这个库进行各种查询\修改\创建\删除等等操作
  • 常用DDL是对数据库及表的各种操作,有创建数据库\创建表\添加字段\修改字段\删除表等操作
  • 常用DML是对数据库中的数据进行的各种操作,如添加数据,修改数据,删除数据等操作
  1. CREATE DATABASE test;//创建名为test的数据库
  2. CREATE TABLE user(id int,username varchar(30),password varchar(60),email varchar(30),c_time int(10));
  3. //创建user表并添加字段:id,username,password,email,c_time
  4. INSERT INTO user (username,password,email,c_time) VALUES ('缘亦如此','123456','326280@qq.com','1629389260');
  5. //在user表中添加一条数据,username值为缘亦如此,password值为123456,email值为326280@qq.com,c_time的时间戳为1629389260
  6. INSERT INTO user (username,password,email,c_time) VALUES ('缘亦1','123456','3262801@qq.com','1629389250');
  7. INSERT INTO user (username,password,email,c_time) VALUES ('缘亦2','123456','3262802@qq.com','1629389290');//在user表中总共添加3条数据
  8. UPDATE user SET password="666666" where id = 1;
  9. //将user表中id值为1的数据password值改为666666

2. 新建一张用户表;


Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post