主流数据库MYSQL/MSSQL/ORACLE测试数据库脚本代码
/******************************************************************************/
/*
主流数据库MYSQL/MSSQL/ORACLE测试数据库脚本代码
脚本任务:建立4个表,添加主键,外键,插入数据,建立视图
运行环境1:microsoft sqlserver 2000 查询分析器
运行环境2:mysql5.0 phpMyAdmin网页界面
运行环境3:oracle 9i SQL*PLUS命令行界面
author:chinayaosir
blog: http://blog.csdn.net/chinayaosir/
QQ: 44633197
声明:严禁其它网站不经过作者chinayaosir同意任意转载
*/
/******************************************************************************/
/*script test ok with microsoft sqlserver 2000 查询分析器 */
/******************************************************************************/
/*DB:MSSQL2000 SCRIPT*/
/*0.drop table list*/
drop table Employee;
drop table Department;
drop table Post;
drop table Account;
/*********************************************************/
/*DB:MSSQL2000 SCRIPT*/
/*1.create all table*/
create table Account(
oid int not null,
username varchar(30) not null,
password varchar(10) null,
invalid varchar(1) null
);
create table bab.Post(
/*oid int identity(1,1) not null primary key,*/
oid int not null,
postName varchar(30) not null
);
create table Department(
oid int not null,
deptName varchar(30) not null,
parentid int null,
manager varchar(30) null,
email varchar(30) null
);
create table Employee(
oid int&nb
相关文档:
1、MySQL常用命令
create database name; 创建数据库
use databasename; 选择数据库
drop database name 直接删除数据库,不提醒
show tables; 显示表
describe tablename; 表的详细描述
select 中加上distinct去除重复字段
mysqladmin drop databasename 删除数据库前,有提示。
显示当前mysql版本和当前日期
s ......
[ 配置 ]
执行增量备份的前提条件是MySQL打开log-bin日志开关,例如在my.ini或my.cnf中加入 log-bin=C:/Program Files/MySQL/MySQL Server 6.0/Data/mysql-bin “log-bin=”后的字符串为日志记载目录,一般建议放在不同于mysql数据目录的磁盘上。
[ 完全备份]
假定星期日下午1点执行完全备份,适用于MyISAM ......
以下这篇文章论述上在什么情况下子查询比一般的内连接查询更加快速
http://www.mysqlperformanceblog.com/2010/03/18/when-the-subselect-runs-faster/
以下是我对mysql的order by和limit优化的建议,要适表的数据量和用来过滤列的唯一值的个数而定
(1)where子句中用来过滤结果的列所在索引的cadinality很小,即用相关 ......
组成LVS最重要的部分有三个:请求分发服务器、处理服务器、共享存储。
典型的Web集群并不需要共享存储,只有请求分发服务器和处理服务器,如下图所示:
如果完成请求需要基于数据,那么共享存储就是LVS必须的组件了。LVS邮件服务器集群如下所示:
目前能应用于LVS的MySQL集群只能是NDB Cluster,因为MySQL众多的存储引擎 ......
一下是一个SQL的小问题,困扰了3分钟,写下来记录一下。
数据库是MYSQL 5, 表的结构很简单, 就一个字段是abc,整型。
一下语句运行的结果是一样的。自己不留神,导致困扰了3分钟。
select * from table1 from abc = '123'
select * from table1 from abc = '123_1'
以上语句原来是查找是否数据存在,结果123_1和1 ......