1.创建数据库
mysql> create DATABASE booktik
-> ;
Query OK, 1 row affected (0.02 sec)
2.创建表
mysql> use booktik
Database changed
mysql> create TABLE book(
-> id INT,
-> bookname VARCHAR(1024),
-> size INT);
Query OK, 0 rows affected (0.20 sec)
3.插入数据
mysql> insert into book
-> (id, bookname, size)
-> values
-> (1, "server", 100)
-> ;
Query OK, 1 row affected (0.06 sec)
4.查询数据
mysql> select * from book
-> ;
+------+----------+------+
| id | bookname | size |
+------+----------+------+
| 1 | server | 100 |
+------+----------+------+
1 row in set (0.05 sec)