/
MySQL 基础教程 1 2 3 MySQL 基础教程 1 2 3

MySQL 基础教程 1 2 3 - PowerPoint Presentation

pinperc
pinperc . @pinperc
Follow
343 views
Uploaded On 2020-07-02

MySQL 基础教程 1 2 3 - PPT Presentation

MySQL 语句入门 数据库 概念 4 增删改查语句介绍 整形列的字节与存储范围 5 6 7 浮点列 整形列的可选属性 8 字符型列 日期时间列类型 9 10 11 ID: 792780

unsigned class values tinyint class unsigned tinyint values age2 insert age add zerofill class

Share:

Link:

Embed:

Download Presentation from below link

Download The PPT/PDF document "MySQL 基础教程 1 2 3" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

MySQL

基础教程

Slide2

1

2

3

MySQL

语句入门

数据库

概念

4

增删改查语句介绍

整形列的字节与存储范围

Slide3

5

6

7

浮点列

整形列的可选属性

8

字符型列

日期时间列类型

Slide4

9

10

11

增删改查语法详解

建表案例

12

安装

ecshop

phpMyAdmin

阶段总结

Slide5

第五讲

-整形列的可选属性

tinyint可选参数介绍:tinyint(M) unsigned zerofill注释

:1、tinyint默认为无符号数2、

M: 宽度,在zerofill填充的时候才有意义3、unsigned: 无符号类型(非负),影响存储范围

4、zerofill: 零填充,如果某列zerofill,默认就是unsigned

Slide6

第五讲

-整形列的可选属性-unsigned

练习题:在class表中添加一个名为

age2的列,类型为tinyint unsigned,插入数值256,-5,255

,看是否成功答案:alter

table class add age2 tinyint unsigned;//

在表class中添加一列age2,tinyint为unsigned。insert into class (name, age, age2) values (‘lisi’,25,256);

//age2的范围为0-255,故256插入失败,同理,下面语句的-5也插入失败insert into class (name, age, age2) values (‘lisi’,25,-5);//失败

insert into class (name, age, age2) values (‘lisi’,25,255);//成功

Slide7

第五

讲-整形列的可选属性

-M练习题:在class表中添加一个列age3

,类型为tinyint(1)

答案: alter table class add age3 tinyint(1);

Slide8

五讲-整型列的可选属性

-M练习题:在class表中添加一个列

age4,类型为tinyint(5) zerofill

答案:

alter table class add age4 tinyint(5) zerofill;

Slide9

第五讲

-整形列的可选属性

答案:insert into class (name,age4) values (‘zhaoliu’,9);//age4占用的字符为5

个,当插入的数据为一位的时候,前面4位补零

练习题:在表class中,向name列和age4列插入数值,age 为

9,查看age4的显示