Dams are built for various purposes, such as irrigation, flood control, hydroelectric power generation, and drinking water supply.