-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpropertymanagement.sql
129 lines (129 loc) · 4.07 KB
/
propertymanagement.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
CREATE DATABASE propertymanagement;
USE propertymanagement;
CREATE TABLE accounts (
id int(110) NOT NULL AUTO_INCREMENT,
username varchar(50) NOT NULL,
fullname varchar(50) NOT NULL,
email varchar(50) NOT NULL,
mobile varchar(10) NOT NULL,
password varchar(255) NOT NULL,
cpassword varchar(255) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE apartmentdetail (
A_ID int(110) NOT NULL AUTO_INCREMENT,
Aname varchar(50) NOT NULL,
Email varchar(100) NOT NULL,
Mobile decimal(10,0) NOT NULL,
Plot_no int NOT NULL,
Address varchar(100) NOT NULL,
Landmark varchar(100) NOT NULL,
City varchar(50) NOT NULL,
Pincode decimal(6,0) NOT NULL,
State varchar(50) NOT NULL,
Country varchar(50) NOT NULL,
Atype varchar(50) NOT NULL,
RS varchar(4) NOT NULL,
Availability varchar(20) NOT NULL,
Price numeric NOT NULL,
Facilities varchar(250) NOT NULL,
Dscrption varchar(500) NOT NULL,
image varchar(10000) NOT NULL,
Username varchar(50) NOT NULL,
PRIMARY KEY (A_ID)
);
CREATE TABLE roomdetail(
R_ID int NOT NULL AUTO_INCREMENT,
Email varchar(100) NOT NULL,
Mobile numeric(10) NOT NULL,
Room_no varchar(50) NOT NULL,
Address varchar(100) NOT NULL,
Landmark varchar(100) NOT NULL,
City varchar(50) NOT NULL,
Pincode decimal(6,0) NOT NULL,
State varchar(50) NOT NULL,
Country varchar(50) NOT NULL,
Availability varchar(20) NOT NULL,
Rent numeric NOT NULL,
Facilities varchar(250) NOT NULL,
Dscrption varchar(500) NOT NULL,
image varchar(10000) NOT NULL,
Username varchar(50) NOT NULL,
PRIMARY KEY (R_ID)
);
CREATE TABLE complaints (
C_ID int NOT NULL AUTO_INCREMENT,
A_ID int NOT NULL,
Aname varchar(50) NOT NULL,
Complaint varchar(250) NOT NULL,
Flag int(1) DEFAULT 0,
PRIMARY KEY (C_ID),
FOREIGN KEY (A_ID) REFERENCES apartmentdetail(A_ID) ON DELETE CASCADE
);
CREATE TABLE complaints2 (
C_ID int NOT NULL AUTO_INCREMENT,
R_ID int NOT NULL,
Room_no varchar(50) NOT NULL,
Complaint varchar(250) NOT NULL,
Flag int(1) DEFAULT 0,
PRIMARY KEY (C_ID),
FOREIGN KEY (R_ID) REFERENCES roomdetail(R_ID) ON DELETE CASCADE
);
CREATE TABLE Buy_propertyapt(
bapt_id int(110) NOT NULL AUTO_INCREMENT,
A_ID int(110) NOT NULL,
Aname varchar(50) NOT NULL,
Fullname varchar(50) NOT NULL,
Email varchar(100) NOT NULL,
Mobile decimal(10,0) NOT NULL,
Age int NOT NULL,
Address varchar(100) NOT NULL,
Landmark varchar(100) NOT NULL,
City varchar(50) NOT NULL,
Pincode decimal(6,0) NOT NULL,
State varchar(50) NOT NULL,
Occupation varchar(50) NOT NULL,
Username varchar(50) NOT NULL,
Applicant varchar(50) NOT NULL,
Status varchar(50) NOT NULL,
primary key(bapt_id),
foreign key(A_ID) references apartmentdetail(A_ID) ON DELETE CASCADE
);
CREATE TABLE Buy_propertyroom(
bapt_id int(110) NOT NULL AUTO_INCREMENT,
R_ID int(110) NOT NULL,
Room_no varchar(50) NOT NULL,
Fullname varchar(50) NOT NULL,
Email varchar(100) NOT NULL,
Mobile decimal(10,0) NOT NULL,
Age int NOT NULL,
Address varchar(100) NOT NULL,
Landmark varchar(100) NOT NULL,
City varchar(50) NOT NULL,
Pincode decimal(6,0) NOT NULL,
State varchar(50) NOT NULL,
Occupation varchar(50) NOT NULL,
Username varchar(50) NOT NULL,
Applicant varchar(50) NOT NULL,
Status varchar(50) NOT NULL,
primary key(bapt_id),
foreign key(R_ID) references roomdetail(R_ID) ON DELETE CASCADE
);
CREATE TABLE approved (
X_ID int NOT NULL AUTO_INCREMENT,
Aname varchar(50) NOT NULL,
Applicant varchar(50) NOT NULL,
email varchar(50) NOT NULL,
mobile varchar(10) NOT NULL,
PRIMARY KEY (X_ID)
);
CREATE TABLE approved2 (
X_ID int NOT NULL AUTO_INCREMENT,
Room_no varchar(50) NOT NULL,
Applicant varchar(50) NOT NULL,
email varchar(50) NOT NULL,
mobile varchar(10) NOT NULL,
PRIMARY KEY (X_ID)
);
INSERT INTO accounts (id, username, fullname,email,mobile,password,cpassword) VALUES (1, 'admin', 'admin','[email protected]','1234567890','$2b$12$27a0Gq6GPpr6IT.ANU4RS.lpb9avi5FlPC0PWgk9JaW8r0on830ka','$2b$12$27a0Gq6GPpr6IT.ANU4RS.lpb9avi5FlPC0PWgk9JaW8r0on830ka');
Select * from accounts;