Retail Insight interview question

How SQL joins work. As well as difference between having/where.