Mercury + Gemini + Apollo had a 0% death rate in-flight. Not that they didn't come very close.
The shuttle had numerous design flaws. The use of solid fuel. A booster that was assembled in seven different sections, fastened, and sealed with rubber o-rings. Go-fever. Foam insulation that was known to fall off and strike the orbiter during launch.
Not that space flight isn't dangerous. My point is we can do a lot better with proper designs and attitudes. SpaceX also gets to examine and improve their stages in a way that has never been possible now that they come back in one piece.