Correct verb tenses for if-would-type sentences


I've been confused about this ever since I started to learn Japanese: What is
the correct verb tense for sentences like "If I had known ... then I would
have"?

Concrete example:

If I had known that (it was not going to be so hot today) I would've joined
the competition.

My attempt:

それを分かったら、大会に出る。

I've been stuck for words in this situation lots of times.




I think you could say:

> (もし)それが分かっていたら/いれば、大会に出たのに。  
>  ～～、大会に出ていたのに。  
>  ～～、大会に出ていただろう(に)。  
>  ～～、大会に出たんだけど(なぁ)。  
>  ～～、大会に出ていたんだけど(なぁ)。  
>  etc.

Example:

> (もし)彼女の電話番号を知ってたら/れば、電話したのに。/してたのに。/してただろう(に)。/したんだけど(なぁ)。etc.  
>  (If I had known her phone number, I would have called her.)

Compare:

> (もし)彼女の電話番号を知ってれば/たら、電話 **する** のに。/ **する** だろう(に)。/ **する** んだけど(なぁ)。etc.  
>  (If I knew her phone number, I would call her.)

