jQuery licensen

jQuery licensen

I have some questions regarding jQuery and what rules one must follow when using jQuery. I would much appreciate if my questions were answer as I have difficulty finding the answers online.

Firstly, if I want to use jQuery in a commercial project what rules must I be considerate of?

Secondly, if a part of my code is based on examples from jQuery, what are the rules then?

Lastly, if I want to write a plugin for jQuery, what licensens must I abide by and why?