
DELETE FROM RESPONSE_PZ
WHERE pz_id IN 
	(SELECT resp_id FROM RESPONSE
	 WHERE resp_type = 'Z' AND seqresp_id IN
		(SELECT seqresp_id FROM SENSOR_COMPONENT
		 WHERE sensor_id IN
			(SELECT sensor_id FROM SENSOR
			 WHERE serial_nb = '50202'
			)
		)
	);

DELETE FROM RESPONSE_LP
WHERE lp_id IN
	(SELECT resp_id FROM RESPONSE
	 WHERE resp_type = 'L' AND seqresp_id IN
                (SELECT seqresp_id FROM SENSOR_COMPONENT
                 WHERE sensor_id IN
                        (SELECT sensor_id FROM SENSOR
                         WHERE serial_nb = '50202'
                        )
                )       
        );


DELETE FROM RESPONSE_HP
WHERE hp_id IN
        (SELECT resp_id FROM RESPONSE
         WHERE resp_type = 'H' AND seqresp_id IN
                (SELECT seqresp_id FROM SENSOR_COMPONENT
                 WHERE sensor_id IN
                        (SELECT sensor_id FROM SENSOR
                         WHERE serial_nb = '50202'
                        )
                )       
        );

DELETE FROM RESPONSE
WHERE seqresp_id IN
	(SELECT seqresp_id FROM SENSOR_COMPONENT
	 WHERE sensor_id IN
		(SELECT sensor_id FROM SENSOR
		 WHERE serial_nb = '50202'
		)
	);

DELETE FROM SENSOR_COMPONENT
WHERE sensor_id IN
	(SELECT sensor_id FROM SENSOR
	 WHERE serial_nb = '50202'
	);

DELETE FROM SENSOR
WHERE serial_nb = '50202';

