创建数据库
mysql> create database python3 charset=utf8;
Query OK, 1 row affected
创建表:
mysql> use python3;
Database changed
mysql> create table student(
-> id int auto_increment primary key,
-> sname varchar(10) not null,
-> sage int not null,
-> gender varchar(10) not null,
-> class varchar(10) not null);
Query OK, 0 rows affected
全列插入:
mysql> insert into student values(1,"小明","7","男","一班");
Query OK, 1 row affected
缺省插入:
mysql> insert into student(sname,sage) values("小红",8);
Query OK, 1 row affected
多行插入:
mysql> insert into student values(3,"小一",7,"男","二班"),(4,"小二",7,"男","二班"),(5,"小程",7,"男","二班");
Query OK, 3 rows affected
Records: 3 Duplicate