We carry out a linear analysis of the vertical normal modes of axisymmetric perturbations in stratified, compressible, self-gravitating gaseous discs in the shearing-box approximation. An unperturbed disc has a polytropic vertical structure that allows us to study specific dynamics for subadiabatic, adiabatic and superadiabatic vertical stratifications, by simply varying the polytropic index. In the absence of self-gravity, four well-known principal modes can be identified in a stratified disc: acoustic p modes, surface gravity f modes, buoyancy g modes and inertial r modes. After classifying and characterizing modes in the non-self-gravitating case, we include self-gravity in the perturbation equations and in the equilibrium and investigate how it modifies the properties of these four modes. We find that self-gravity, to a certain degree, reduces their frequencies and changes the structure of the dispersion curves and eigenfunctions at radial wavelengths comparable to the disc height. Its influence on the basic branch of the r mode, in the case of subadiabatic and adiabatic stratifications, and on the basic branch of the g mode, in the case of superadiabatic stratification (which in addition exhibits convective instability), does appear to be strongest. Reducing the 3D Toomre's parameter Q3D results in the latter modes becoming unstable due to self-gravity, so that they determine the onset criterion and nature of the gravitational instability of a vertically stratified disc. By contrast, the p, f and convectively stable g modes, although their corresponding ω2 are reduced by self-gravity, never become unstable however small the value of Q3D. This is a consequence of the three dimensionality of the disc. The eigenfunctions corresponding to the gravitationally unstable modes are intrinsically three dimensional. We also contrast the more exact instability criterion based on our 3D model with that of density waves in 2D (razor-thin) discs. Based on these findings, we comment on the origin of surface distortions seen in numerical simulations of self-gravitating discs.