MySQL数据表相关语句

创建数据表:

mysql> create table student(
    -> id int(4) not null,
    -> name varchar(20) not null,
    -> age tinyint(2) not null default '0',
    -> dept varchar(16) default null
    -> );

查看数据表:

mysql> show tables;                # 查看有哪些表
mysql> desc student;               # 查看表结构
mysql> select * from student; # 查看表数据
mysql
> show create table student; # 查看建表语句

    

猜你喜欢

转载自www.cnblogs.com/pzk7788/p/9466089.html
今日推荐