MySQL第二次作业

发布时间:2024年01月13日

一、创建英雄表(hero)

mysql> use db_han
Database changed
mysql> create table hero(
    -> name varchar(20) primary key,
    -> nickname varchar(20),
    -> address varchar(20),
    -> `groups` varchar(20),
    -> emile int,
    -> telephone int);
Query OK, 0 rows affected (0.03 sec)

二、插入数据

mysql> insert into hero values("宋江","呼保义","水浒传","北宋",1231,1232);
Query OK, 1 row affected (0.01 sec)

mysql> insert into hero values("卢俊义","玉麒麟","水浒传","北宋",3211,33232);
Query OK, 1 row affected (0.01 sec)

mysql> insert into hero values("吴用","智多星","水浒传","山东",7894,4789);
Query OK, 1 row affected (0.00 sec)

mysql> insert into hero values("菩萨","观音","西游记","天庭",4561,1654);
Query OK, 1 row affected (0.01 sec)

mysql> insert into hero values("姜子牙","姜太公","封神英雄","商朝",3265,,5612);
Query OK, 1 row affected (0.01 sec)

mysql> insert into hero values("姬发","三公子","封神英雄","商朝",2255,525522);
Query OK, 1 row affected (0.00 sec)

mysql> insert into hero values("孙悟空","齐天大圣","西游记","花果山",99666,6699);
Query OK, 1 row affected (0.00 sec)

mysql> insert into hero values("哪吒","那拏天","封神英雄","商朝",4466,62644);
Query OK, 1 row affected (0.00 sec)

mysql> insert into hero values("林冲","豹子头","水浒传","东京",4587,7854);
Query OK, 1 row affected (0.01 sec)

mysql> insert into hero values("司马懿","司马老贼","三国演义","三国",99822,2299);
Query OK, 1 row affected (0.01 sec)

三、显示表中所有数据

文章来源:https://blog.csdn.net/2301_77475090/article/details/135572319
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。