1. 程式人生 > >建庫,建表,新增資料 SQL命令

建庫,建表,新增資料 SQL命令

 

create database ssm default character set utf8;

use ssm;

create table flower(
    id int(10) primary key auto_increment comment'編號',
    name VARCHAR(30) not null comment '花名',
    price float not null comment '價格',
    production varchar(30) not null comment '原產地'
);

    insert into flower values(default,'矮牽牛',2.5,'南美阿根廷');
    insert into flower values(default,'百日草',5.0,'墨西哥');
    insert into flower values(default,'半枝蓮',4.3,'巴西');

select * from flower;