CREATE TABLE Department
(
DepartmentNo int not null default 0,
DepartmentName varchar(20) not null default ''
)
CREATE TABLE ShiftDetail
(
ShiftNo int not null default 0,
ShiftName varchar(20) not null default '',
StartTime varchar(8) not null default '08:00:00',
EndTime varchar(8) not null default '16:00:00'
)
CREATE TABLE Employee
(
EmployeeId int not null default 0,
FirstName varchar(20) not null default '',
LastName varchar(20) not null default '',
DOB datetime not null default '1900-01-01',
Sex varchar(1) not null default 'M',
Address varchar(50) not null default '',
Phone varchar(20) not null default '',
JoinDate datetime not null default '1900-01-01',
HourlyWage money not null default 0,
Active bit not null default '1',
JobTitle varchar(20) not null default '',
DepartmentNo int not null default 0
)
CREATE TABLE EmployeeAttendance
(
LogId int identity(1,1) not null,
EmployeeId int not null default 0,
SignInDate datetime not null default '1900-01-01',
SignOutDate datetime not null default '1900-01-01',
Remark varchar(50) not null default ''
)
CREATE TABLE EmployeeReport
(
ReportNo int not null default 0,
ReportDate datetime not null default '1900-01-01',
EmployeeId int not null default 0,
StartDate datetime not null default '1900-01-01',
EndDate datetime not null default '1900-01-01',
WorkingHour varchar(20) not null default '',
LateMinute int not null default 0
)
--------------------------------------------------
-------- 03. Add Field On Table --------
--------------------------------------------------
ALTER TABLE Employee
ADD ShiftNo int not null default 0
--------------------------------------------------
-------- 04. Change Data Type On Field --------
--------------------------------------------------
ALTER TABLE EmployeeAttendance
ALTER COLUMN Remark varchar(100)
(
DepartmentNo int not null default 0,
DepartmentName varchar(20) not null default ''
)
CREATE TABLE ShiftDetail
(
ShiftNo int not null default 0,
ShiftName varchar(20) not null default '',
StartTime varchar(8) not null default '08:00:00',
EndTime varchar(8) not null default '16:00:00'
)
CREATE TABLE Employee
(
EmployeeId int not null default 0,
FirstName varchar(20) not null default '',
LastName varchar(20) not null default '',
DOB datetime not null default '1900-01-01',
Sex varchar(1) not null default 'M',
Address varchar(50) not null default '',
Phone varchar(20) not null default '',
JoinDate datetime not null default '1900-01-01',
HourlyWage money not null default 0,
Active bit not null default '1',
JobTitle varchar(20) not null default '',
DepartmentNo int not null default 0
)
CREATE TABLE EmployeeAttendance
(
LogId int identity(1,1) not null,
EmployeeId int not null default 0,
SignInDate datetime not null default '1900-01-01',
SignOutDate datetime not null default '1900-01-01',
Remark varchar(50) not null default ''
)
CREATE TABLE EmployeeReport
(
ReportNo int not null default 0,
ReportDate datetime not null default '1900-01-01',
EmployeeId int not null default 0,
StartDate datetime not null default '1900-01-01',
EndDate datetime not null default '1900-01-01',
WorkingHour varchar(20) not null default '',
LateMinute int not null default 0
)
--------------------------------------------------
-------- 03. Add Field On Table --------
--------------------------------------------------
ALTER TABLE Employee
ADD ShiftNo int not null default 0
--------------------------------------------------
-------- 04. Change Data Type On Field --------
--------------------------------------------------
ALTER TABLE EmployeeAttendance
ALTER COLUMN Remark varchar(100)
0 komentar:
Post a Comment