The pyramids were built at diffeent times but, unless we lknow the date of the flood we can't knwo for sure what was cam first, the flood or the pyramids.
Sumerian
Further information: Eridu Genesis
The earliest extant flood legend is contained in the fragmentary SumerianEridu Genesis, datable by its script to the 17th century BCE. [ 1 ]
The story tells how the god Enki warns Ziusudra (meaning "he saw life," in reference to the gift of immortality given him by the gods), of the gods' decision to destroy mankind in a flood—the passage describing why the gods have decided this is lost. Enki instructs Ziusudra (also known as Atrahasis) to build a large boat—the text describing the instructions is also lost. After which he is left to repopulate the earth, as in many other flood legends.
After a flood of seven days, Zi-ud-sura makes appropriate sacrifices and prostrations to An (sky-god) and Enlil (chief of the gods), and is given eternal life in Dilmun (the Sumerian Eden) by An and Enlil.
[edit] Babylonian (Epic of Gilgamesh)
Further information: Epic of Gilgamesh The "Deluge tablet" (tablet 11) of the Epic of Gilgamesh in Akkadian.
In the Babylonian Epic of Gilgamesh, toward the end of the He who saw the deep version by Sin-liqe-unninni, there are references to the great flood (tablet 11). This was a late addition to the Gilgamesh cycle, largely paraphrased or copied verbatim from the Epic of Atrahasis (see above).
The hero Gilgamesh, seeking immortality, searches out Utnapishtim in Dilmun, a kind of paradise on earth. Utnapishtim tells how Ea (equivalent of the Sumerian Enki) warned him of the gods' plan to destroy all life through a great flood and instructed him to build a vessel in which he could save his family, his friends, and his wealth and cattle. After the Deluge the gods repented their action and made Utnapishtim immortal.
[edit] Jewish
Main article: Noah's Ark
The best-known version of the Jewish deluge legend is contained in the Book of Genesis (Genesis 6–9). Two non-canonical books, the Enoch and Jubilees, both later than Genesis, contain elaborations on the Genesis story.
Genesis tells how "...the Lord saw that the wickedness of man was great in the earth, and that every intent of the thoughts of his heart was only evil continually. And the Lord was sorry that He had made man on the earth, and was grieved in His heart. So the Lord said, 'I will blot out man whom I have created from the face of the land, from man to animals to creeping things and to birds of the sky; for I am grieved that I have made them.'" [ 2 ]
God selects Noah, a man who "found favor in the eyes of the Lord" [ 3 ] and commands him to build an ark [ 4 ] to save Noah, his family, and the Earth's animals and birds. After Noah builds the ark, "all the fountains of the great deep burst open, and the floodgates of the sky were opened" [ 5 ] . Rain falls for 40 days, the water rises 150 days, and all the high mountains are covered. [ 6 ] On the 27th of Cheshvan of the year 1657 from Creation (2104 BCE) "the earth dried" (Genesis 8:14) completing the 365-day duration of the Great Flood. The ark rests on the mountains, the water recedes for 150 days, until the waters are gone and Noah opens up the ark. At this point Noah sends out a raven and then a dove to see if the flood waters have receded. Noah and the animals leave the ark, Noah offers a sacrifice to God, and God places a rainbow in the clouds as a sign that he will never again destroy the Earth by water.
The apocryphal 2nd century BCE 1st Book of Enoch adds to the Genesis flood story by saying that God sent the Great Flood to rid the earth of the Nephilim, the titanic children of the Grigori, the "sons of God" mentioned in Genesis, and of human females.