mysql 操作table

2017-02-07  本文已影响10人  klisly

对 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)

上一篇 下一篇

猜你喜欢

热点阅读