Above is a wiring diagram for a standard, 3-way lamp switch. This socket is used with a three way bulb containing 2 separate elements that are energized separately and then together as the switch knob is turned, for varying degrees of light.
It’s not unusual for an old house to have an old doorbell lurking about somewhere that hasn’t worked in years. Fortunately, it’s likely a simple matter to get things back in working order. As illustrated in the above diagram, the parts of an old doorbell circuit include the bell, a button mounted at the door, and a battery somewhere in between the two.
The white wire on the switch loop is used to carry current from the source to the switch and it is marked with black tape or paint to label it as hot. The black on the switch loop runs from the top switch terminal to the top half of the receptacle. With this arrangement the top half of the duplex is controlled with the switch and the bottom half is always hot.
This diagram illustrates the arrangement for a 20 amp double receptacle circuit with a shared neutral wire. This arrangement is typically used in a kitchen where two appliance circuits are needed in close proximity to each other.