In big Cruise ships there may be additionally a Security Dept and Surveillance Dept but I won't delve into these any further.
The Deck Department is lead by the Chief Officer and he has usually below him at least a 1st Officer (if not then we're talking abt a very small boat) and the bigger the vessel gets the more Officer's he has, the responsibilities being separated to Safety, Maintenance, Security and Navigation. Below the Officer's there is usually a Boatswain (Bosun) sometimes followed by a Carpenter, then, Able Seamen, Ordinary Seamen and Apprentice's. The difference from Apprentice to Boatswain is mostly years of experience onboard as well as necessary courses to be taken for the qualification.
The Engine Department is lead by the Chief Engineer and has usually below him a 1st Engineer who is then followed by other Engineer's depending on the Machinery onboard. Below the Engineer's there is traditionally a Donkeyman, Fitter's, Motormen, Oilers and Wipers. Same applies here too as in Deck department, for higher rank depends years of experience and education level.
The Hotel Department is lead by the Hotel Manager and depending on the size of ship loads of people below and I won't even attempt to explain it here. On yachts the Chief Steward has a row of Stewardesses, a Chef and sometimes a Sous Chef (2nd Cook) as well as a Laundryman.