-
Notifications
You must be signed in to change notification settings - Fork 0
/
real-estate-sql.txt
94 lines (64 loc) · 2.18 KB
/
real-estate-sql.txt
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
CREATE Table users(
user_id int not null primary key auto_increment,
user_name varchar(100) not null,
user_pwd varchar(100) not null);
CREATE Table buyers(
buyer_id int primary key auto_increment,
location varchar(100) not null ,
price int not null,
name varchar(100) not null,
phone varchar(100) not null,
email varchar(100) not null
);
CREATE Table sellers(
seller_id int primary key auto_increment,
address varchar(100) not null ,
style varchar(100) not null,
price int not null,
name varchar(100) not null,
phone varchar(100) not null,
email varchar(100) not null
);
CREATE Table newsletteremails(
newsletter_id int not null primary key auto_increment,
email varchar(100) not null);
CREATE Table Featured(
Featured_id int primary key auto_increment,
featured_image varchar(100),
featured_address varchar(100),
featured_available varchar(100)
);
INSERT INTO users VALUES (1, 'rosy', 'rosy1234');
Create procedure addbuyer(
IN p_location varchar(100),
IN p_price int,
IN p_name varchar(100),
IN p_phone varchar(100),
IN p_email varchar(100))
INSERT INTO Buyers(location, price, name, phone, email)
VALUES(p_location, p_price, p_name, p_phone, p_email) ;
Create procedure GetAllBuyers()
Select * from buyers order by buyer_id desc;
Create procedure addseller(
IN p_address varchar(100),
IN p_style varchar(100),
IN p_price int,
IN p_name varchar(100),
IN p_phone varchar(100),
IN p_email varchar(100))
INSERT INTO sellers(address, style, price, name, phone, email)
VALUES(p_address, p_style, p_price, p_name, p_phone, p_email) ;
Create procedure GetAllSellers()
Select * from sellers order by seller_id desc;
Create procedure GetAllNewsletterEmails()
Select * from newsletteremails order by newsletter_id desc;
Create procedure addnewsletteremail(
IN p_email varchar(100))
--
INSERT INTO newsletteremails( email)
VALUES( p_email) ;
--
Create procedure GetAllFeatured()
Select * from Featured order by Featured_id desc;
--
INSERT INTO Featured VALUES ( '1.jpg', 'XXXXXXXXXXXXXXX', 'AVAILABLE');