mysql常用命令:

连接mysql数据库:mysql -uroot -p

查看版本号:select version();

create database tempdb char set utf8;

use tempdb;

create table student(
    id int not null auto_increment primary key comment 'id',
    name varchar(16) not null comment '姓名',
    birthday datetime comment '出生年月',
    score float default 0 comment '高考总成绩',

    index ix_name(name),
    index ix_birthday(birthday)
);

insert into student(name,birthday,score) values
    ('张三','1998-1-1',512),
    ('李四','2000-2-1',618),
    ('王五','2001-3-1',null),
    ('悟空','1999-4-1',700),
    ('八戒','1999-3-1',88);

  

原文地址:https://www.cnblogs.com/apple2016/p/14781593.html