An air compressor that includes an external enclosure having an opening at its outer surface and an electrically-operated compressor unit within the enclosure, the compressor unit including a cylinder and a storage container provided with a plurality of outlets, the storage container communicating with the cylinder, the cylinder being fitted with a piston body driven by a motor for conducting a reciprocating motion for supplying compressed air into the storage container; wherein one of the outlets is mounted with an audible alarm device to produce a high-frequency sound for alerting users when the pressure of the compressed air within the storage container or the cylinder exceeds a predetermined value, characterized in that the cylinder has a top wall and an open bottom, the top wall of the cylinder being formed with a first coupling means that includes two substantially opposite plates extending outwardly from the top wall, one side of each plate being formed into a first holding portion defining a first receiving slot; and further wherein the storage container defines therein an inner space and has a closed top and an open bottom, wherein the open bottom is formed with a second coupling means that includes two substantially opposite plates extending outwardly from the surrounding wall of the storage container, one side of each opposite plate being formed into a second holding portion that has a base section and an end section, the base section being perpendicular to the corresponding plate of the storage container, the end section being parallel to the corresponding plate of the storage container to thus define a second receiving slot between the base section and the end section; whereby the storage container is capable of being rotated to allow the plates thereof to slide in the first receiving slots and allow the plates of the cylinder to slide in the second receiving slots, wherein the plates of the cylinder are limited by the base sections of the storage container, so that the storage container is firmly and detachably mounted to the cylinder, wherein the top wall of the cylinder defines a through hole communicating with an inner space of the cylinder and the inner space of the storage container and is formed thereon with a tubular connection portion that defines an annular groove at its outer surface for receiving therein a seal ring and is provided with a plurality of ribs at its inner surface so that a ventilation gap is defined between two adjacent ribs; further wherein a valve plug is provided in a central space surrounded by the ribs, the valve plug having coaxially formed portions including a bottom round portion, a middle round portion and a top round portion, the bottom round portion having a diameter greater than the middle round portion, the middle round portion having a diameter greater than the top round portion, the bottom round portion having a diameter less than the central space but greater than the through hole of the top wall, the compressed air produced in the inner space (3 5) of the cylinder being able to enter the inner space of the storage container via the ventilation gaps between the ribs; further wherein the storage container is provided with a central column extending downwardly from an inner surface of the closed top of the storage container, a first annular protrusion at the inner surface of the closed top of the storage container around the central column, and a second annular protrusion at the inner surface of the closed top of the storage container around the first annular protrusion, such that a first annular groove is defined between the central column and the first annular protrusion, and a second annular groove is defined between the first annular protrusion and the second annular protrusion; and further wherein a spring is provided in the storage container such that one end of the compression spring is fitted around the central column while urged against the first annular groove, and the other end of the spring is fitted around the top round portion of the valve plug while urged against the middle round portion of the valve plug, and wherein a second spring is provided in the storage container such that one end of the second spring is fitted around the central column while urged against the second annular groove, and the other end of they second spring is fitted around the middle round portion of the valve plug while urged against the bottom round portion of the valve plug.