MySQL
文章平均质量分 74
Jack_Lpz
Jack_Li style
展开
-
mysql使用04
mysql> #现在我们来看看重叠问题mysql> mysql> create table sessions( -> id int primary key not null auto_increment, -> app varchar(10) not null, -> usr varchar(10) not null, -> starttime ti原创 2014-09-15 12:53:26 · 439 阅读 · 0 评论 -
mysql的使用18
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #pivotingmysql> #pivo原创 2014-09-17 10:21:03 · 465 阅读 · 0 评论 -
mysql的使用20
mysql> #事务 是数据库区别于文件系统的重要特性之一 mysql> #在sql编程中 事务编程成为必不可少的一个部分,事务能够保证数据从一种一致状态转化为另一种状态mysql> #在数据库提交时 可以确保其要么对所有的修改都已经保存 要么对所有的操作都不保存mysql> #事务是访问并更新数据库中各种数据库项的一个程序执行单元mysql> #原子性:是指整个数据库事务原创 2014-09-17 10:23:26 · 536 阅读 · 0 评论 -
mysql的使用17
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #刚才插入有问题哈mysql> mys原创 2014-09-17 10:20:11 · 438 阅读 · 0 评论 -
mysql的使用21
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #隔离级别mysql> #如果用户想要在m原创 2014-09-17 10:24:12 · 454 阅读 · 0 评论 -
mysql的使用22
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #MyISAM存储引擎其实更像一整堆表,所有的原创 2014-09-17 10:24:55 · 460 阅读 · 0 评论 -
mysql的使用25
mysql> create table listPart( -> a int,b int)engine=innodb -> partition p0values in (1,3,5,7,9), -> partition p0values in (0,2,4,6,8));ERROR 1064 (42000): You have an error in your SQ原创 2014-09-17 10:25:48 · 1525 阅读 · 0 评论 -
mysql的使用15
mysql> #滑动订单问题mysql> create table MonthlyOrders -> ( -> ordermonth date primary key -> ordernum int unsigned -> );ERROR 1046 (3D000): No database selectedmysql> use test;Re原创 2014-09-17 10:16:42 · 511 阅读 · 0 评论 -
mysql的使用16
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> show tables;+--------原创 2014-09-17 10:19:25 · 409 阅读 · 0 评论 -
mysql的使用24
mysql> #自适应哈希索引mysql> #自适应哈西索引采用之前讨论的三列表的方式实现mysql> #查看当前自适应哈西索引的使用情况mysql> show engine innodb status;+--------+------+-------------------------------------------------------------------------原创 2014-09-17 10:27:00 · 585 阅读 · 0 评论 -
mysql的使用19
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #rollupmysql> #rollup原创 2014-09-17 10:22:22 · 884 阅读 · 0 评论 -
mysql的使用23
mysql> #联合索引mysql> #是指对表上的多个列进行索引,联合索引的创建方法与单个索引的创建方法一样,不同之处仅在于多个所以列mysql> create table indext(a int, b int, primary key(a), key idx_a_b(a,b))engine=innodb;ERROR 1046 (3D000): No database select原创 2014-09-17 10:23:41 · 501 阅读 · 0 评论 -
mysql的使用14
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> show tables;+--------原创 2014-09-16 21:08:05 · 571 阅读 · 0 评论 -
mysql的使用13
mysql> show tables;+----------------+| Tables_in_test |+----------------+| Nums || a || animals || charTest || customers || dept_manager |原创 2014-09-16 20:49:57 · 435 阅读 · 0 评论 -
mysql的使用12
mysql> create table dept_manager( -> dept_no varchar(10) primary key not null, -> emp_no int not null, -> birth_date date, -> worktime date);Query OK, 0 rows affected (0.10 sec)原创 2014-09-16 20:48:56 · 471 阅读 · 0 评论 -
mysql使用07
mysql> #昨天的函数使用发生了一点点错误哈mysql> show tables;ERROR 1046 (3D000): No database selectedmysql> use test;Reading table information for completion of table and column namesYou can turn off this fea原创 2014-09-15 12:57:52 · 751 阅读 · 0 评论 -
mysql使用01
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> create table account(原创 2014-09-15 12:49:44 · 545 阅读 · 0 评论 -
mysql使用02
mysql> #首先进行unsigned的测试mysql> use test;Database changedmysql> show tables;+----------------+| Tables_in_test |+----------------+| a || employees || t |原创 2014-09-15 12:50:43 · 427 阅读 · 0 评论 -
mysql使用05
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #现在我们来讨论星期数的问题mysql>原创 2014-09-15 12:54:24 · 475 阅读 · 0 评论 -
mysql使用06
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #现在 我们来看一下 整型的数据mysql原创 2014-09-15 12:55:36 · 499 阅读 · 0 评论 -
mysql使用03
mysql> #介绍datetime 和 timestamp的比较mysql> mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AData原创 2014-09-15 12:50:15 · 452 阅读 · 0 评论 -
mysql使用08
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> #blob 数据和 Text数据mysql原创 2014-09-15 19:35:49 · 562 阅读 · 0 评论 -
nysql使用09
mysql> #查询操作 (物理查询(代表mysql数据库是如何得到该结果的) 逻辑查询(表示执行查询该产生什么样的结果))mysql> #现在创建两个表 说明查询的一般步骤mysql> show tables;ERROR 1046 (3D000): No database selectedmysql> use test;Reading table informati原创 2014-09-15 19:36:42 · 539 阅读 · 0 评论 -
mysql使用10
mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> show tables;+--------原创 2014-09-15 19:37:50 · 1922 阅读 · 0 评论 -
mysql使用11
mysql> #exists是一个非常强大的谓词 它允许数据库高效的检查指定查询是否产生某些行mysql> #通常exists的输入是一个子查询 并关联到外部查询mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature原创 2014-09-15 19:36:42 · 473 阅读 · 0 评论 -
mysql的使用11
mysql> #exists是一个非常强大的谓词 它允许数据库高效的检查指定查询是否产生某些行mysql> #通常exists的输入是一个子查询 并关联到外部查询mysql> use test;Reading table information for completion of table and column namesYou can turn off this feature原创 2014-09-16 20:48:00 · 457 阅读 · 0 评论 -
mysql实现sequence自增长
1、创建表tb_sequence,用来存放sequence值: create table tb_sequence(name varchar(50) not null,current_value int not null,_increment int not null default 1, primary key(name)); 2.现在插入一条记录 insert into t原创 2016-08-25 21:24:22 · 419 阅读 · 0 评论