A deck is a permanent covering over a compartment or a hull of a ship. On a boat or ship, the primary or upper deck is the horizontal structure that forms the "roof" of the hull, strengthening it and serving as the primary working surface. Vessels often have more than one level both within the hull and in the superstructure above the primary deck, similar to the floors of a multi-storey building, that are also referred to as decks, as are certain compartments and decks built over specific areas of the superstructure. Decks for some purposes have specific names.
RMS Olympic's deck
The upper deck of the Falls of Clyde is iron; a centre strip is planked with wood as a sort of walkway. As is typical for a late-19th-century vessel, several deckhouses may be seen.
Crew and passengers on the wraparound deck of RMS Queen Mary 2, an ocean liner
Weather deck of the Swedish 17th-century warship Vasa looking aft toward the sterncastle
A compartment is a portion of the space within a ship defined vertically between decks and horizontally between bulkheads. It is analogous to a room within a building, and may provide watertight subdivision of the ship's hull important in retaining buoyancy if the hull is damaged. Subdivision of a ship's hull into watertight compartments is called compartmentation.
Transverse bulkheads appear horizontally in this photo of the battleship USS South Dakota (BB-57) under construction.
These compartments are formed by non-structural bulkheads.
A watertight hatch with the door dogs clearly visible