ar(10), @E_mail varchar(20)РasРbeginРbegin tranРdeclare @remain varchar(10), @pay float, @distance intР if (@cabin = '头等舱')Р begin Р select @remain = remain_f from flight_choose where flight_number = @flight_numberР select @pay = price_f from flight_choose where flight_number = @flight_numberР endР elseР begin Р select @remain = remain_s from flight_choose where flight_number = @flight_numberР select @pay = price_s from flight_choose where flight_number = @flight_numberР endР select @distance = distance from flight_choose where flight_number = @flight_numberР if (@remain = '有')Р beginР if (exists(select passenger_name from Passenger where passenger_name = @passenger_name))Р begin Р declare @distances floatР select @distances = distances from Passenger where passenger_name = @passenger_name