We report synchrotron x-ray diffraction investigations of interfacially engineered oxygen octahedral rotations and their impact on strain relief in perovskite SrRuO3 films. We show that octahedral rotations with distinct patterns and magnitudes can be accommodated into coherently grown films. The SrRuO3 film grown directly on the GdScO3 substrate has the RuO6 octahedral rotation with the a-b+c- pattern in the Glazer notation and the rotation angles of αrot=6.6±0.2°, βrot=5.5±0.2°, and γrot=3.6±0.2°. On the other hand, when a 1-nm-thick BaTiO3 layer without TiO6 rotations is inserted between the SrRuO3 and GdScO3, the SrRuO3 has the RuO6 rotation with a-b0c+, and αrot=5.6±0.8° and γrot=3.6±0.8°. These results indicate that there are some degrees of freedom in the octahedral rotations accommodated in SrRuO3 depending on the interface structure and that the γrot rotations play the important roles in the film's structural properties when the rotation about the pc axis is blocked. We also found that the strain relief in the film is influenced by the interfacially engineered octahedral rotations. The interfacial BaTiO3 layer results in the in-plane periodic lattice modulation in the t-SRO film, allowing for the anisotropic relief of the substrate-induced strain. The results highlight the importance of the interface structure as a factor, determining not only octahedral rotations in coherently grown SRO films but also the strain reliefs in them.