-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateDB.sql
More file actions
77 lines (59 loc) · 3.89 KB
/
createDB.sql
File metadata and controls
77 lines (59 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
use master
go
use PMSystemDb
go
insert into Departments values('Development')
insert into Departments values('Design')
insert into Departments values('Marketing x')
select * from Departments
insert into Roles values('Manager')
insert into Roles values('Employee')
select * from Roles
insert into Employees values('han@gmail.com', 'pwd123', N'Nguyễn Thị Mỹ Hân', '056391346', 100.0, 1, 1, 1)
insert into Employees values('han1@gmail.com', 'pwd123', N'Nguyễn Hữu Toàn', '056391346', 100, 1, 2, 2)
insert into Employees values('han2@gmail.com', 'pwd123', N'Trịnh Ngọc Trung Trực', '056391346', 100, 0, 3, 3)
insert into Employees values('HRexample@gmail.com', 'HRexample123', 'Human Resource', '0123456789', 100, 1, 4, 3)
select * from Employees
insert into Projects values('Demo Project', N'Đây là mô tả dự án', 'In Progress', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null)
insert into Projects values('Demo Project 2', N'Đây là mô tả dự án', 'Pending', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null)
insert into Projects values('Demo Project 2', N'Đây là mô tả dự án', 'Warning', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null)
insert into Projects values('Demo Project 4', N'Đây là mô tả dự án', 'Complete', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null)
select * from Projects
select * from ProjectDepartments
insert into ProjectDepartments values('1', '1', 0)
insert into ProjectDepartments values('1', '2', 1)
insert into ProjectDepartments values('1', '3', 1)
insert into ProjectDepartments values('2', '2', 0)
insert into ProjectDepartments values('3', '3', 0)
insert into ProjectDepartments values('4', '1', 0)
insert into ProjectDepartments values('4', '2', 1)
insert into Missions values('Demo Mission 1', 'This is description of mission', 'To Do', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 1)
insert into Missions values('Demo Mission 2', 'This is description of mission', 'Done', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 1)
insert into Missions values('Demo Mission 3', 'This is description of mission', 'In Progress', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 1)
insert into Missions values('Demo Mission 4', 'This is description of mission', 'In Progress', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 1)
insert into Missions values('Demo Mission 21', 'This is description of mission', 'To Do', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 2)
insert into Missions values('Demo Mission 22', 'This is description of mission', 'Done', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 2)
insert into Missions values('Demo Mission 23', 'This is description of mission', 'In Progress', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 3)
insert into Missions values('Demo Mission 24', 'This is description of mission', 'In Progress', '2012-02-21T18:10:00', '2013-02-21T18:10:00', null, null, 4)
select * from Missions
insert into EmployeeMissions values (1,1, null)
insert into EmployeeMissions values (1,2, null)
insert into EmployeeMissions values (1,3, null)
insert into EmployeeMissions values (1,4, null)
insert into EmployeeMissions values (2,1, null)
insert into EmployeeMissions values (2,2, null)
insert into EmployeeMissions values (3,1, null)
insert into EmployeeMissions values (3,2, null)
insert into EmployeeMissions values (2,5, null)
insert into EmployeeMissions values (2,6, null)
insert into EmployeeMissions values (3,7, null)
insert into EmployeeMissions values (3,8, null)
select * from EmployeeMissions
select * from Documents
select * from Notifications
-- Disable foreign key constraints
EXEC sp_MSforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL';
-- Delete data from all tables
EXEC sp_MSforeachtable 'DELETE FROM ?';
-- Enable foreign key constraints
EXEC sp_MSforeachtable 'ALTER TABLE ? WITH CHECK CHECK CONSTRAINT ALL';