How to create package to deploy modules

I have developed a module in OXID-esales. Now What I want to ask the how to deploy my oxid module to oxid market place. Second How to create the package for deployment. I had some conversation regarding to this in this thread. But I have still confusion how to deploy it. For example how many folders will be there. Where to keep on SQL quries and how to instruct the user to run the query. Where to run these query? What will be the structure?