-
Notifications
You must be signed in to change notification settings - Fork 3
/
Database.sql
158 lines (132 loc) · 7.53 KB
/
Database.sql
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
--- Database Name : SCorner
---
-- Login Table.
-- Roles
-- 1. Admin
-- 2. Student
-- 3. Professor
-- 4. Moderator
CREATE TABLE IF NOT EXISTS `Login` (
`Sno` int NOT NULL AUTO_INCREMENT,
`RollNo` text NOT NULL,
`UserName` text NOT NULL,
`Password` text NOT NULL,
`Role` int(11) NOT NULL,
`Email` text NOT NULL,
PRIMARY KEY (SNo)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `Profile` (
`Sno` int NOT NULL AUTO_INCREMENT,
`RollNo` text NOT NULL,
`Name` text NOT NULL,
`Phone number` text NOT NULL,
`Year` int(11) NOT NULL,
`Email` text NOT NULL,
`Address` text NOT NULL,
`UserName` text NOT NULL,
PRIMARY KEY (SNo)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Standard Login values for testing different environments.
INSERT INTO Login VALUES (1,'12345','root',MD5('root'),1,'[email protected]');
INSERT INTO Login VALUES (2,'67890','studentroot',MD5('studentroot'),2,'[email protected]');
INSERT INTO Login VALUES (3,'34567','profroot',MD5('profroot'),3,'[email protected]');
INSERT INTO Login VALUES (4,'24689','modroot',MD5('modroot'),4,'[email protected]');
insert into Profile values(1,'12345','Someone','999999999',2,'[email protected]','blablabla blabla bla blalbalbalballalbla','root');
insert into Profile values(2,'67890','Someone2','888888888',3,'[email protected]','blablabla blabla bla blalbalbalballalbla','studentroot');
insert into Profile values(3,'34567','Someone3','777777777',1,'[email protected]','blablabla blabla bla blalbalbalballalbla','profroot');
insert into Profile values(4,'24689','Someone4','666666666',3,'[email protected]','blablabla blabla bla blalbalbalballalbla','modroot');
-- Short Anonymous Posts. Used for ranting about problems.
-- Type 1 : Complaint
-- Type 2 : Request
-- Type 3 : Enhancement
-- Type 4 : Rant
CREATE TABLE IF NOT EXISTS `AnonymousPosts` (
`Sno` int NOT NULL AUTO_INCREMENT,
`Date` datetime NOT NULL,
`PostContent` text NOT NULL,
`Type` int NOT NULL,
`LikeCount` int NOT NULL,
`Name` text NOT NULL,
PRIMARY KEY(Sno)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Sample Values for Anonymous Posts
INSERT INTO `AnonymousPosts` (`Date`, `PostContent`, `Type`,`LikeCount`,`Name`) VALUES
('2014-06-02 00:00:00', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nemo numquam officiis distinctio similique consequuntur provident eveniet aliquid reprehenderit. Dignissimos, expedita, omnis? Rerum, itaque, alias mollitia omnis quos quas a tempora.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, praesentium, a, velit excepturi saepe fuga vel unde labore quae reiciendis enim sit quod nesciunt. Esse sed corporis quam eos ratione!Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi, earum, sit, repudiandae nostrum itaque quia maiores vel amet placeat tenetur voluptatem eaque odit impedit voluptate nulla! Blanditiis officiis atque architecto?', 1,0,"Anonymous"),
('2014-06-02 00:00:00', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nemo numquam officiis distinctio similique consequuntur provident eveniet aliquid reprehenderit. Dignissimos, expedita, omnis? Rerum, itaque, alias mollitia omnis quos quas a tempora.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, praesentium, a, velit excepturi saepe fuga vel unde labore quae reiciendis enim sit quod nesciunt. Esse sed corporis quam eos ratione!Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sequi, earum, sit, repudiandae nostrum itaque quia maiores vel amet placeat tenetur voluptatem eaque odit impedit voluptate nulla! Blanditiis officiis atque architecto?', 1,0,"Anonymous"),
('2014-06-25 00:00:00', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nemo numquam officiis distinctio similique consequuntur provident eveniet aliquid reprehenderit. Dignissimos, expedita, omnis? Rerum, itaque, alias mollitia omnis quos quas a tempora.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, praesentium, a, velit excepturi saepe fuga vel unde labore quae reiciendis enim sit quod nesciunt. Esse sed corporis quam eos ratione!', 2,0,"Anonymous"),
('2014-06-27 00:00:00', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nemo numquam officiis distinctio similique consequuntur provident eveniet aliquid reprehenderit. Dignissimos, expedita, omnis? Rerum, itaque, alias mollitia omnis quos quas a tempora.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, praesentium, a, velit excepturi saepe fuga vel unde labore quae reiciendis enim sit quod nesciunt. Esse sed corporis quam eos ratione!', 3,0,"Anonymous"),
('2014-06-20 00:00:00', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nemo numquam officiis distinctio similique consequuntur provident eveniet aliquid reprehenderit. Dignissimos, expedita, omnis? Rerum, itaque, alias mollitia omnis quos quas a tempora.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, praesentium, a, velit excepturi saepe fuga vel unde labore quae reiciendis enim sit quod nesciunt. Esse sed corporis quam eos ratione!', 4,0,"Anonymous");
CREATE TABLE IF NOT EXISTS `store` (
`itemID` int(11) NOT NULL AUTO_INCREMENT,
`UserID` text NOT NULL,
`Name` text NOT NULL,
`ItemDescription` text NOT NULL,
`CategoryID` text NOT NULL,
`Quantity` int(11) NOT NULL,
`MRP` double(10,0) NOT NULL,
`DealPrice` double(10,0) NOT NULL,
`Available` int(11) NOT NULL,
PRIMARY KEY (`itemID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `store`
--
INSERT INTO `store` (`itemID`, `UserID`, `Name`, `ItemDescription`, `CategoryID`, `Quantity`, `MRP`, `DealPrice`, `Available`) VALUES
(1, '1', 'Chair', 'Loren ipsum Dolor chetos lays banana buga buga bugaaa', '2', 0, 2300, 1800, 1),
(2, '1', 'Table', 'Loren ipsum Dolor chetos lays banana buga buga bugaaa', '2', 0, 1300, 1000, 1),
(3, '1', 'Fan', 'Loren ipsum Dolor chetos lays banana buga buga bugaaa', '1', 0, 300, 180, 1),
(4, '1', 'Cycle', 'Loren ipsum Dolor chetos lays banana buga buga bugaaa', '3', 0, 4300, 2800, 1);
-- --------------------------------------------------------
--
-- Table structure for table `store_categories`
--
CREATE TABLE IF NOT EXISTS `store_categories` (
`CategoryID` int(11) NOT NULL,
`CategoryName` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `store_categories`
--
INSERT INTO `store_categories` (`CategoryID`, `CategoryName`) VALUES
(1, 'Electronics'),
(2, 'Furniture'),
(3, 'Transport');
------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `like_history` (
`sno` int(11) NOT NULL,
`username` text NOT NULL,
`activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table structure for table `comments`
--
CREATE TABLE IF NOT EXISTS `comments` (
`commentID` int(11) NOT NULL AUTO_INCREMENT,
`sno` int(11) NOT NULL,
`date` datetime NOT NULL,
`userID` int(11) NOT NULL,
`username` text NOT NULL,
`content` text NOT NULL,
PRIMARY KEY (`commentID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Keeping log track of user logins
--
-- @session_Status :
-- 1. Active.
-- 2. Ended session.
CREATE TABLE IF NOT EXISTS `USAGE_HISTORY`(
`IP_ADDRESS` text NOT NULL,
`SessionStatus` int NOT NULL,
`LoginID` text NOT NULL,
`LoginTime` datetime NOT NULL,
`LogoutTime` datetime
);
CREATE TABLE IF NOT EXISTS `illegal_access` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip_address` text NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`page_accessed` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;