/******************************************************************************/
/*
主流数据库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