列出 MySQL 数据库管理系统的数据库列表
show databases;
创建新数据库 mysql_data
create database mysql_data;
选择要操作的指定数据库
USE mysql_data;
列出所有的数据库

在数据库中创建新数据表 student
create table student(id int auto_increment primary key,name varchar(16) not null,age int,sex char(5));
列出指定数据库的所有表格
show tables;

查询表内数据
select * from student;
增:向表插入数据
insert into student values(1,'zhangsan',23,'m');
insert into student values(2,'lisi',32,'m');

删:删除表数据
delete from student where id = 2;

改:更改表内数据
update student set age="55" where age="23";

本文围绕 MySQL 数据库管理系统展开,介绍了列出数据库列表、创建新数据库、选择指定数据库等操作,还涉及在数据库中创建新数据表、列出表格,以及对表内数据进行查询、插入、删除和更改等操作。
1939

被折叠的 条评论
为什么被折叠?



