mysql 操作table

对 table 的操作是基于某个database 的,所以,在操作表前需要选择database,

使用命令:  use database 数据库名称

1、创建空的table

mysql>create table  students(id int unsigned not nullauto_increment primary key

,name char(8) not null,sex char(4) not null,age tinyint unsigned not null,tel ch

ar(13) null default "-");

Query OK, 0 rows affected (0.27 sec)

2、查看table结构

mysql>describe  students;

或者:

mysql> desc teacher;

3、删除table

mysql>drop table  test;

Query OK, 0 rows affected (0.15 sec)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容