forked from Fretwells/PropertyDatabase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProperty.sql
154 lines (135 loc) · 3.54 KB
/
Property.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
CREATE PROCEDURE anthony_insert_Property
@PAdderss varchar(50),
@PCity varchar(30),
@PState varchar(20),
@PZipcode varchar(9),
@PBuiltYear char(4),
@NName varchar(30),
@PTName varchar(50)
AS
DECLARE @N_ID INT, @PT_ID INT
SET @N_ID = (SELECT NeighborhoodID
FROM tblNEIGHBORHOOD
WHERE NeighborhoodName = @NName)
SET @PT_ID = (SELECT PropertyTypeID
FROM tblPROPERTY_TYPE
WHERE PropertyTypeName = @PTName)
BEGIN TRANSACTION H1
INSERT INTO tblPROPERTY(NeighborhoodID, PropertyTypeID, PropAddress, PropCity, PropState, PropZipcode, PropBuiltyear)
VALUES (@N_ID, @PT_ID, @PAdderss, @PCity, @PState, @PZipcode, @PBuiltYear)
COMMIT TRANSACTION H1
GO
DROP PROCEDURE anthony_insert_Property
go
--https://www.zillow.com/homedetails/3807-S-Cloverdale-St-Seattle-WA-98118/2077548865_zpid/
EXECUTE anthony_insert_Property
@PAdderss = '911 N 95th St 909',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98103',
@PBuiltYear = '1999',
@NName = 'Greenwood',
@PTName = 'Townhouse'
GO
EXECUTE anthony_insert_Property
@PAdderss = '11348 Durland Ave NE',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98125',
@PBuiltYear = '1921',
@NName = 'Olympic Hill',
@PTName = 'Single Family'
GO
EXECUTE anthony_insert_Property
@PAdderss = '3807 S Cloverdale St',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98118',
@PBuiltYear = '2020',
@NName = 'Rainier Valley',
@PTName = 'Townhouse'
GO
EXECUTE anthony_insert_Property
@PAdderss = '3807 S Cloverdale St',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98118',
@PBuiltYear = '2020',
@NName = 'Rainier Valley',
@PTName = 'Townhouse'
GO
--https://www.zillow.com/homedetails/762-Hayes-St-APT-18-Seattle-WA-98109/49101737_zpid/
EXECUTE anthony_insert_Property
@PAdderss = '762 Hayes St APT 18',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98109',
@PBuiltYear = '1977',
@NName = 'Queen Anne',
@PTName = 'Condominium'
GO
--https://www.zillow.com/homedetails/6224-7th-Ave-NW-Seattle-WA-98107/48824487_zpid/
EXECUTE anthony_insert_Property
@PAdderss = '6224 7th Ave NW',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98107',
@PBuiltYear = '1909',
@NName = 'Ballard',
@PTName = 'Single Family'
GO
--https://www.zillow.com/homedetails/311-NE-40th-St-UNIT-B-Seattle-WA-98105/2065735607_zpid/
EXECUTE anthony_insert_Property
@PAdderss = '311 NE 40th St UNIT B',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98105',
@PBuiltYear = '2015',
@NName = 'Northlake',
@PTName = 'Apartment'
GO
--https://www.zillow.com/homedetails/6315-22nd-Ave-NW-6315-Seattle-WA-98107/2065739065_zpid/
EXECUTE anthony_insert_Property
@PAdderss = '6315 22nd Ave NW #6315',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98107',
@PBuiltYear = '2015',
@NName = 'Ballard',
@PTName = 'Apartment'
GO
--https://www.zillow.com/homedetails/6315-22nd-Ave-NW-6315-Seattle-WA-98107/2065739065_zpid/
EXECUTE anthony_insert_Property
@PAdderss = '1121 10th Ave E',
@PCity = 'Seattle',
@PState = 'WA',
@PZipcode = '98102',
@PBuiltYear = '2013',
@NName = 'Capitol Hill',
@PTName = 'Single Family'
GO
Exec dbo.anthony_insert_Property
"201 Municipal Dr, Nampa, ID 83687",
"Nampa",
"ID",
"83687",
"2005",
"Ada",
"Mobile Home"
Go
Exec dbo.anthony_insert_Property
"1090 E Watertower St #150, Meridian, ID 83642",
"Meridian",
"ID",
"83642",
"1990",
"Ada",
"Townhouse"
Go
DELETE FROM tblPROPERTY WHERE PropertyID = 77
go
BEGIN TRANSACTION H1
INSERT INTO tblPROPERTY(NeighborhoodID, PropertyTypeID, PropAddress, PropCity, PropState, PropZipcode, PropBuiltyear)
VALUES (9, 6, '911 N 95th St #909', 'Seattle', 'WA', '98103', '1999')
COMMIT TRANSACTION H1
GO