这种条件语句怎么写?
甲表: 
  专业 必修课 选修课 
     101            A                     a 
          101            C       
          102            A                     b 
          102                                    c 
          103            A                     a 
          103            B                     b 
          103                                    d   
 乙表: 
       院系 专业 必修课 学时 学分   
 --------------------- 
 先查询乙表 select   *   from   乙   where    院系= '电子系 ' 
 如果查询出数据则显示,如果没有查询到,则执行   
 insert   into   乙表(院系,专业,必修课,学时,学分) 
 select 
         '电子系 '   as   院系, 
             专业                                    , 
             必修课                              , 
             null               as   学时, 
             null               as   学分 
 from 
             甲表 
 where 
             isnull(必修课, ' ')   !=    ' '   
 ------------------------------------ 
 这个语句怎么写?
------解决方案--------------------if not exists(select 1 from 乙 where  院系= '电子系 ') 
 begin 
 insert into 乙表(院系,专业,必修课,学时,学分) 
 select 
     '电子系 ' as 院系, 
     专业            , 
     必修课          , 
     null     as 学时, 
     null     as 学分 
 from 
     甲表 
 where 
     isnull(必修课, ' ') !=  ' '   
 end 
 else  
     select * from 乙 where  院系= '电子系 '