The diurnal cycle throughout the stratosphere is analyzed by applying Bayesian interpolation to COSMIC GPS radio occultation (RO) data and three scientific applications of the analysis are introduced. COSMIC RO data is the only data set that completely samples the diurnal cycle in the stratosphere continuously for a decade, providing a unique opportunity to explore several scientific topics related to the diurnal cycle in the stratosphere. First, the migrating thermal tides are analyzed with unprecedented accuracy and precision, with an uncertainty in the analysis of the vertically propagating tides ranging from 0.1 in the lower stratosphere to 0.6 K in the upper stratosphere for an individual month of RO data and the uncertainty in a ten-year climatological diurnal cycle a factor of 10 less. This enables potential observational studies of the forcing of the tides in the troposphere and the stratosphere. Moreover, the mid-latitude trapped tide is found to be smaller than what is produced by an atmospheric model and lags the model in phase, a likely consequence of a faulty parameterization of eddy diffusivity in the upper stratosphere. Second, a clear signal of solar cycle influence on the diurnal cycle is evident in this analysis, but whether the cause is the systematic bias of ionospheric residual associated with RO retrieval or it is an actual atmospheric phenomenon is less clear. The pattern suggests ionospheric residual is dominant, but modeling studies will be necessary to address the question. Third, RO satellites and missions that obtain inadequate coverage of the diurnal cycle will be biased by under-sampling it, whether or not sub-sampling weather forecasts is used to removal sampling error. The analysis of the diurnal cycle in COSMIC RO data can be used to diagnose the systematic sampling error incurred by incomplete coverage of the diurnal cycle, which is of the order of 0.2 K for a Metop-based RO climatology.