-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_stations.sql
More file actions
21 lines (20 loc) · 986 Bytes
/
Copy pathinsert_stations.sql
File metadata and controls
21 lines (20 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
delimiter $$
create trigger for_station before insert on station
for each row
begin
if new.station_id = '' then
signal sqlstate '45000';
end if;
end;$$
delimiter ;
INSERT IGNORE INTO station (station_id,station_name) VALUES (2,"Goa");
INSERT IGNORE INTO station (station_id,station_name) VALUES (6,"Hyderabad");
INSERT IGNORE INTO station (station_id,station_name) VALUES (8,"Punjab");
INSERT IGNORE INTO station (station_id,station_name) VALUES (1,"Chruchgate");
INSERT IGNORE INTO station (station_id,station_name) VALUES (5,"Pune");
INSERT IGNORE INTO station (station_id,station_name) VALUES (4,"Howrah");
INSERT IGNORE INTO station (station_id,station_name) VALUES (3,"Surat");
INSERT IGNORE INTO station (station_id,station_name) VALUES (10,"Bandra");
INSERT IGNORE INTO station (station_id,station_name) VALUES (9,"Bangalore");
INSERT IGNORE INTO station (station_id,station_name) VALUES (11,"Mumbai");
INSERT IGNORE INTO station (station_id,station_name) VALUES (7,"Delhi");