초간단 인사정보 Sample Schema MS-SQL

CREATE TABLE CodeDept (
DeptCD int Primary Key identity(1001,10) ,
DeptDesc nvarchar (30) NULL ,
)
GO


CREATE TABLE CodeGroup (
groupCD int Primary Key identity(10001,10) ,
groupName nvarchar (20) NOT NULL ,
deptCD int Foreign Key References CodeDept(DeptCD) ,
Point int DEFAULT (0)
)
GO


CREATE TABLE CodeStyle (
styleCD int IDENTITY (0, 1) Primary key NOT NULL ,
styleName nvarchar(30) not null
)
GO


CREATE TABLE CodeClass(
classCD int identity(0,1) Primary key,
className NVarchar(30) not null
)


CREATE TABLE CodeTitle(
titleCD int identity(0,1) Primary Key,
titleName NVarchar(30) not null
)

CREATE TABLE Employee (
UserCN int Primary key identity(100001,1) NOT NULL,
UserCode nvarchar(24) DEFAULT ('00000000'),
UserID nvarchar (12) NULL,
Pwd nvarchar (30) DEFAULT ('netmarble'),
UserName nvarchar (20) NOT NULL,
Address NVarchar(300) NULL,
PhoneNumber Varchar(15) null,
MobileNumber Varchar(15) null,
Email NVarchar(50) null,
MobileMail NVarchar(50) null,
Messager NVarchar(50) DEFAULT (''),
groupCD int Foreign Key References CodeGroup(groupCD) ,
styleCD int Foreign Key References CodeStyle(styleCD) ,
classCD int Foreign Key References CodeClass(classCD) ,
titleCD int Foreign Key References CodeTitle(titleCD) ,
JoinDate smalldatetime DEFAULT (getdate()),
Regdate smalldatetime DEFAULT (getdate()),
WorkOut tinyint default(0),
WorkOutDate tinyint null
)
GO