sql数据库的建立查询和表的增删改查

1、创建数据库:create datebase mydb01;
2、查询数据库:show databases;
3、查询指定数据库:show create database mydb01;
4、删除数据库:drop database mydb01;
5、修改数据库名称:alter database mydb01 character set utf8;
2、创建表格;
1、create table student(
id int,
name varchar(10),
borthday date
);
2、查看所有表:show tables;
3、查看表结构:desc student;
4、删除表:drop table student;
5、添加字段:alter table student add column product varchar(20);
6、删除字段:alter table student drop column name;
7、修改字段类型:alter table student modify column id varchar(10);
8、修改字段名称:alter table student change column name pname varchar(30);
9、修改表名称:alter table student rename to pstudent;

原文地址:https://www.cnblogs.com/hankai2735/p/11181042.html