MySQL 作业(1)

题目:

创建一个英雄表(hero)
主键
name
nickname
address
groups
email
telphone

mysql> create database hero;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| hero               |
| information_schema |
| mysql              |
| performance_schema |
| sakila             |
| sys                |
| world              |
+--------------------+
7 rows in set (0.00 sec)

mysql> use hero
Database changed

mysql> create table t_hero(name varchar(50), nickname varchar(50), address varchar(50), `group` varchar(30), email varchar(30), telphone int);

mysql>  desc t_hero;
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| name     | varchar(50) | YES  |     | NULL    |       |
| nickname | varchar(50) | YES  |     | NULL    |       |
| address  | varchar(50) | YES  |     | NULL    |       |
| group    | varchar(30) | YES  |     | NULL    |       |
| email    | varchar(30) | YES  |     | NULL    |       |
| telphone | int         | YES  |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> insert into t_hero values ("钢铁侠", "托尼·斯塔克", "纽约", "复仇者联盟", "[email protected]", 1111111),("美国队长", "史蒂夫·罗杰斯", "纽约", "复仇者联盟", "[email protected]",2222222),(" 雷神", "托尔·奥丁森", "阿斯加德", "复仇者联盟", "[email protected]", 333333),("绿巨人", "布鲁斯·班纳", "加州伯克利", "复仇者联盟", "[email protected]", 444444),("鹰眼", "克林特·巴顿", "纽约", " 复仇者联盟", "[email protected]", 555555);
Query OK, 5 rows affected (0.01 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> select * from t_hero;
+----------+----------------+------------+------------+---------------+----------+
| name     | nickname       | address    | group      | email         | telphone |
+----------+----------------+------------+------------+---------------+----------+
| 钢铁侠   | 托尼·斯塔克   | 纽约       | 复仇者联盟 | 111111@aa.com |  1111111 |
| 美国队长 | 史蒂夫·罗杰斯 | 纽约       | 复仇者联盟 | 222222@bb.com |  2222222 |
| 雷神     | 托尔·奥丁森   | 阿斯加德   | 复仇者联盟 | 333333@cc.com |   333333 |
| 绿巨人   | 布鲁斯·班纳   | 加州伯克利 | 复仇者联盟 | 444444@dd.com |   444444 |
| 鹰眼     | 克林特·巴顿   | 纽约       | 复仇者联盟 | 555555@ee.com |   555555 |
+----------+----------------+------------+------------+---------------+----------+
5 rows in set (0.00 sec)

你可能感兴趣的:(MySQL,mysql,android,adb)