-
Notifications
You must be signed in to change notification settings - Fork 0
/
13. city1_99.txt
122 lines (120 loc) · 3.41 KB
/
13. city1_99.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
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
CREATE TYPE status_tbl_cities_enum AS ENUM ('ACTIVE','DEACTIVE');
CREATE TABLE cities(
id SERIAL PRIMARY KEY,
city_name varchar(200) NOT NULL,
region_id int NOT NULL,
status status_tbl_cities_enum DEFAULT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ,
updated_at TIMESTAMP DEFAULT NOW()
);
CREATE OR REPLACE FUNCTION update_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER update_updated_at_trigger
BEFORE UPDATE ON cities
FOR EACH ROW
EXECUTE FUNCTION update_updated_at();
INSERT INTO cities (city_name, region_id, status) VALUES
('Bombuflat', 1,'ACTIVE'),
('Garacharma', 1, 'ACTIVE'),
('Port Blair', 1, 'ACTIVE'),
('Rangat', 1, 'ACTIVE'),
('Addanki', 2, 'ACTIVE'),
('Adivivaram', 2, 'ACTIVE'),
('Adoni', 2, 'ACTIVE'),
('Aganampudi', 2, 'ACTIVE'),
('Ajjaram', 2, 'ACTIVE'),
('Akividu', 2, 'ACTIVE'),
('Akkarampalle', 2, 'ACTIVE'),
('Akkayapalle', 2, 'ACTIVE'),
('Akkireddipalem', 2, 'ACTIVE'),
('Alampur', 2, 'ACTIVE'),
('Amalapuram', 2, 'ACTIVE'),
('Amudalavalasa', 2, 'ACTIVE'),
('Amur', 2, 'ACTIVE'),
('Anakapalle', 2, 'ACTIVE'),
('Anantapur', 2, 'ACTIVE'),
('Andole', 2, 'ACTIVE'),
('Atmakur', 2, 'ACTIVE'),
('Attili', 2, 'ACTIVE'),
('Avanigadda', 2, 'ACTIVE'),
('Badepalli', 2, 'ACTIVE'),
('Badvel', 2, 'ACTIVE'),
('Balapur', 2, 'ACTIVE'),
('Bandarulanka', 2, 'ACTIVE'),
('Banganapalle', 2, 'ACTIVE'),
('Bapatla', 2, 'ACTIVE'),
('Bapulapadu', 2, 'ACTIVE'),
('Belampalli', 2, 'ACTIVE'),
('Bestavaripeta', 2, 'ACTIVE'),
('Betamcherla', 2, 'ACTIVE'),
('Bhattiprolu', 2, 'ACTIVE'),
('Bhimavaram', 2, 'ACTIVE'),
('Bhimunipatnam', 2, 'ACTIVE'),
('Bobbili', 2, 'ACTIVE'),
('Bombuflat', 2, 'ACTIVE'),
('Bommuru', 2, 'ACTIVE'),
('Bugganipalle', 2, 'ACTIVE'),
('Challapalle', 2, 'ACTIVE'),
('Chandur', 2, 'ACTIVE'),
('Chatakonda', 2, 'ACTIVE'),
('Chemmumiahpet', 2, 'ACTIVE'),
('Chidiga', 2, 'ACTIVE'),
('Chilakaluripet', 2, 'ACTIVE'),
('Chimakurthy', 2, 'ACTIVE'),
('Chinagadila', 2, 'ACTIVE'),
('Chinagantyada', 2, 'ACTIVE'),
('Chinnachawk', 2, 'ACTIVE'),
('Chintalavalasa', 2, 'ACTIVE'),
('Chipurupalle', 2, 'ACTIVE'),
('Chirala', 2, 'ACTIVE'),
('Chittoor', 2, 'ACTIVE'),
('Chodavaram', 2, 'ACTIVE'),
('Choutuppal', 2, 'ACTIVE'),
('Chunchupalle', 2, 'ACTIVE'),
('Cuddapah', 2, 'ACTIVE'),
('Cumbum', 2, 'ACTIVE'),
('Darnakal', 2, 'ACTIVE'),
('Dasnapur', 2, 'ACTIVE'),
('Dauleshwaram', 2, 'ACTIVE'),
('Dharmavaram', 2, 'ACTIVE'),
('Dhone', 2, 'ACTIVE'),
('Dommara Nandyal', 2, 'ACTIVE'),
('Dowlaiswaram', 2, 'ACTIVE'),
('East Godavari Dist.', 2, 'ACTIVE'),
('Eddumailaram', 2, 'ACTIVE'),
('Edulapuram', 2, 'ACTIVE'),
('Ekambara kuppam', 2, 'ACTIVE'),
('Eluru', 2, 'ACTIVE'),
('Enikapadu', 2, 'ACTIVE'),
('Fakirtakya', 2, 'ACTIVE'),
('Farrukhnagar', 2, 'ACTIVE'),
('Gaddiannaram', 2, 'ACTIVE'),
('Gajapathinagaram', 2, 'ACTIVE'),
('Gajularega', 2, 'ACTIVE'),
('Gajuvaka', 2, 'ACTIVE'),
('Gannavaram', 2, 'ACTIVE'),
('Garacharma', 2, 'ACTIVE'),
('Garimellapadu', 2, 'ACTIVE'),
('Giddalur', 2, 'ACTIVE'),
('Godavarikhani', 2, 'ACTIVE'),
('Gopalapatnam', 2, 'ACTIVE'),
('Gopalur', 2, 'ACTIVE'),
('Gorrekunta', 2, 'ACTIVE'),
('Gudivada', 2, 'ACTIVE'),
('Gudur', 2, 'ACTIVE'),
('Guntakal', 2, 'ACTIVE'),
('Guntur', 2, 'ACTIVE'),
('Guti', 2, 'ACTIVE'),
('Hindupur', 2, 'ACTIVE'),
('Hukumpeta', 2, 'ACTIVE'),
('Ichchapuram', 2, 'ACTIVE'),
('Isnapur', 2, 'ACTIVE'),
('Jaggayyapeta', 2, 'ACTIVE'),
('Jallaram Kamanpur', 2, 'ACTIVE'),
('Jammalamadugu', 2, 'ACTIVE'),
('Jangampalli', 2, 'ACTIVE');