Create Database If Not Exists new_book; //创建一个数据库
use new_book; //选择数据库
Create Table user( //创建一个数据表
number char(10) Not Null Comment '图书编号',
type char(8) Not Null Comment '类别',
name Varchar(40) Unique Not Null Comment '书名',
time Timestamp Default Current_timestamp Comment'出版时间',
price Float(5,2) Not Null Comment '单价',
member int Not Null Comment'数量'
)Default Charset=utf8;
insert Into user Values //插入数据
('tp.4235','计算机','跟我学网页设计','2009-09-10',23.50,12),
('tp.3361','计算机','网页编程技术','2008-10-01',54.15,23),
('tp.0731','计算机','数据库应用技术','2007-06-10',33.23,31);
select*from user; //查看数据表