mysql操作常用语句

1、创建、删除、使用info

create database info;   // 创建数据库

drop database info;   // 删除数据库info

use info;    // 使用数据库

2、创建表、删除表、插入数据、更新数据、查找数据、删除数据

// 创建student表
create table student(id int primary key auto_increment, name varchar(255), age int,score int);   // 自动向下增长创建;

create table student(id int primary key,name varchar(255),age int, score int);  // 需指定创建id

// 删除表
drop table student;  // 删除表

// 插入数据
insert into student(id, name, age) values(1,'make',18);   // 插入数据1

insert into student(id, name, age, score) values(2,'mary', 20, 60); // 插入数据2

// 更新数据
update student set score = 90 where id =3;  // 跟新数据

// 查找数据
select * from student;   // 从student表中查找所有数据
select score from student where name = 'make';   // 查找make的score

// 删除数据
delete from student where name = 'make';   // 删除make的数据

3、

原文地址:https://www.cnblogs.com/lbx-cnblogs/p/14066625.html