A sedimentary rock is a layered rock that is formed from the compaction, cementation, and the recrystallization of sediments. Compaction is the squeezing together of layers of sediment due to the great weight of overlying layers of rock.