当前位置: 首页 > news >正文

成都网站建设方案服务成都市微信网站建设

成都网站建设方案服务,成都市微信网站建设,wordpress存储数据库文件,打造专业团队DDL DDL语句 数据库定义语言#xff1a;数据库、表、视图、索引、存储过程. 例如:CREATE DROP ALTER DDL库 定义库{ 创建业务数据库#xff1a;CREAATE DATABASE ___数据库名___ ; 数据库名要求{ a.区分大小写 b.唯一性 c.不能使用关键字如 create select d.不能单独使用…DDL DDL语句 数据库定义语言数据库、表、视图、索引、存储过程. 例如:CREATE  DROP ALTER DDL库 定义库{ 创建业务数据库CREAATE DATABASE   ___数据库名___ ; 数据库名要求{ a.区分大小写 b.唯一性 c.不能使用关键字如 create select d.不能单独使用数字和特殊符号“如- e.正常的用拼音或单词即可。 } 查看所有数据库 SHOW  DATABASES; } 选择/进入数据库{ USE  __数据库名___; 调用函数查询当前库 SELECT  database(); } 删除数据库   DROP  DATABASE  __数据库名___; 在Linux系统中的位置(数据库的实体)  /var/lib/mysql/    数据类型 数值类型 常用 整数类型    int  , smallint  ,   mediumint  ,  blgint tinyint 浮点数类型(小数)   float  , double 定点数类型   DEC 位类型   BIT 无符号   UNSIGNED 测试 LAB1:inttinyint的最大值 前言TINYINT有符号型最大127            INT有符号型最大2147483647 a.创建一个表 mysql create table test1( tinyint_test tinyint,int_test int); b.查询表结构 mysql desc test1; ----------------------------------------------------- | Field | Type | Null | Key | Default | Extra | ----------------------------------------------------- | tinyint_test | tinyint(4) | YES | | NULL | | | int_test | int(11) | YES | | NULL | | ----------------------------------------------------- 2 rows in set (0.01 sec) c.插入合法数值 mysql insert into test1 values (111,111); Query OK, 1 row affected (0.09 sec) mysql insert into test1(int_test) values(2147483647); Query OK, 1 row affected (0.05 sec) d.插入非法数值 错误的示例 mysql insert into test1(tinyint_test) values(128); ERROR 1264 (22003): Out of range value for column tinyint_test at row 1 正确的示例 mysql insert into test1(tinyint_test) values(127); mysql insert into test1(int_test) values(2147483648); ERROR 1264 (22003): Out of range value for column int_test at row 1 LAB2无符号unsigned 前言:   数值无符号就只能输入正值不能输入负值 a.创建一个表 mysql create table test2(tinyint_test tinyint unsigned, int_test int unsigned ); Query OK, 0 rows affected (0.00 sec) b.查询表结构 mysql desc test2; -------------------------------------------------------------- | Field | Type | Null | Key | Default | Extra | -------------------------------------------------------------- | tinyint_test | tinyint(3) unsigned | YES | | NULL | | | int_test | int(10) unsigned | YES | | NULL | | -------------------------------------------------------------- 2 rows in set (0.00 sec) c.插入合法数据 mysql insert into test2(tinyint_test) values(255); Query OK, 1 row affected (0.06 sec) mysql insert into test2(int_test) values(2147483648); Query OK, 1 row affected (1.87 sec) d.插入非法数据 mysql insert into test2 values(-20,-20); ERROR 1264 (22003): Out of range value for column tinyint_test at row 1 LAB3零填充zerofill 前言:   zerofill 自动填充0 a.创建一个表 mysql create table t2 (id1 int zerofill, id2 int(6) zerofill ); Query OK, 0 rows affected (0.05 sec) b.查询表结构 mysql desc t2; ------------------------------------------------------------- | Field | Type | Null | Key | Default | Extra | ------------------------------------------------------------- | id1 | int(10) unsigned zerofill | YES | | NULL | | | id2 | int(6) unsigned zerofill | YES | | NULL | | ------------------------------------------------------------- 2 rows in set (0.00 sec) c.插入数据 mysql insert into t2 values(2,2); Query OK, 1 row affected (0.01 sec) d.查询表内容 mysql select * from t2; -------------------- | id1 | id2 | -------------------- | 0000000002 | 000002 | -------------------- 1 row in set (0.00 sec) 字符串类型 枚举类型ENUM  有65536个元素 时间和日期类型 在MySQL数据库中我们可以使用字符串来存储时间但是如果我们需要基于时间字段 进行查询操作(查询在某个时间段内的数据)就不便于查询实现 常用 DATE    TIME    DATETIME   约束类型 DDL表 创表的目的   a.表是数据库存储数据的基本单位 b.表由若干个字段列组成 c.主要是用来存储数据记录行 实例 1.创建表    要求         创建库school                    创建表student1                 语法         create   table 表名(字段名1  类型,字段名2  类型,字段名3  类型 ); mysql CREATE  DATABASE school;#创建数据库schoolmysql use school; #使用库mysql create table student1(  id int, name varchar (20) , sex enum(m,f), age int );# 创建一个表四列Query OK, 0 rows affected (0.03 sec) 2.查看表名     mysql show tables;     查看表名需要进入一个数据库 ------------------ | Tables_in_school | ------------------ | student1         | ------------------ 1 row in set (0.00 sec) 3.表中插入内容     语法         insert into 表名 values(字段值列表...);     插入数据insert into student1 values (1,zhangsan,m,33) ,insert into student1 values (2,lisi,f,20) ,insert into student1 values (1,wangwu,m,40) , 4.查看表内容    mysql select * from student1; 查询表中所有字段的值 5.查看表结构     desc student1; 注意表结构和表内容是两个概念。
http://www.hkea.cn/news/14304701/

相关文章:

  • seo网站提交网页传奇手游排行榜前十名
  • 做仓单的网站网站文本编辑器
  • 高端设计网站建设torrent种子搜索引擎
  • 新乡网站建设哪家正规怎么建设网站商城
  • 做网站租用那个服务器好wordpress多级折叠
  • 有什么推广网站wordpress 添加栏目
  • 找做金融的网站有哪些方面优秀网名
  • 网站开发选题申请理由国外中文网站排行
  • 天河做网站注册网站的免费网址com
  • 网站建设的提升网站建设的规划方案
  • 平台网站建设协议网络营销运营外包
  • 网站建设行业2017长春网站制作
  • 网站运营代理网站建设方案浩森宇特
  • 网上书城网站开发的结论和不足深圳市住房和建设局投诉电话
  • 天津网站建设网页设计公司天津企业建站系统
  • 驻马店做网站的公司现在做外贸前景如何
  • 国外网站网址建c2c网站费用
  • 河南炒股配资网站开发陕西网站建设价格
  • 中国建设银行网站是什么网站的footer怎么做
  • 南昌做网站的公司哪里好土巴兔装修平台电话
  • ic商城网站建设设计说明英文翻译
  • 网站建设在哪里找客户做平台好还是做网站好
  • 做的网站有广告哪个网站上做ppt比较好看的
  • 长沙做网站公司 上联网络国际展览中心有什么展览
  • 制作校园网站惠城区城乡规划建设局网站
  • 网站的总体架构wordpress 清理
  • 外贸网站建设科技最近国际重大新闻
  • 下载cmsv7爱站工具seo综合查询
  • asp装饰公司网站源码电商网站 费用
  • .net做中英文网站网站开发与设计教程