主流数据库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
相关文档:
一般建模可能都会用到:powerdesigner
但是,在建表的时候,我一直没有找到:
DEFAULT CHARACTER SET
COLLATE
两个选项。因此,想了个方法,点击:工具栏-》database-》edit current DBMS
然后,选中:MYSQL50::Script\Objects\Table\Options
在options末尾添加:
ENGINE = %s : list = BDB | HEAP | ISAM | InnoDB ......
配置主从:
两台服务器mysql版本一样,
Server version: 5.1.16-beta-log MySQL Community Server
配置基本一样、启动参数一样
主的可以访问从的,
但是
从那边怎么连接主的,都是失败:
[root@2006 htmlfile]# mysql -h192.168.xx.xxx -uxxx -pxxx --default-character-set=GBK --reconnect
ERROR 2003 (HY000): C ......
以下这篇文章论述上在什么情况下子查询比一般的内连接查询更加快速
http://www.mysqlperformanceblog.com/2010/03/18/when-the-subselect-runs-faster/
以下是我对mysql的order by和limit优化的建议,要适表的数据量和用来过滤列的唯一值的个数而定
(1)where子句中用来过滤结果的列所在索引的cadinality很小,即用相关 ......
dblp数据库中引用信息很少,平均一篇论文引用0.2篇。使用dblp做实验数据集的某篇论文提到,可以随机添加引用信息。受此启发,我打算为每一篇论文都添加20篇随机引用,于是就写出了如下的sql语句:
String sql = "insert into citation(pId1,pId2) values( (selec ......