The setup and the statistic
One sample, one claimed population mean, and σ unknown: the one-sample t-test is the workhorse for "is this batch/study/class different from the standard?". The statistic is t = (x̄ − μ0) ÷ (s/√n), on n − 1 degrees of freedom. The sample SD stands in for σ, and the t distribution's heavier tails, fatter at small n, charge honestly for that substitution.
Target: 40 sales a day. Eight days give x̄ = 44.5, s = 4.751, so the standard error is 4.751 ÷ √8 = 1.680 and t = 4.5 ÷ 1.680 = 2.679 on 7 df. Two-tailed p = 0.0316: at the 0.05 level the bakery's mean is significantly above target. Cohen's d = 4.5 ÷ 4.751 = 0.947, a large standardised effect, and the 95% confidence interval for the true mean, 40.53 to 48.47, excludes 40 while showing the precision eight days buy: the mean is somewhere between just above target and well above it.
Assumptions, and what breaks them
Independence matters most: eight days from the same week share weather and payday effects, and no formula in the test knows that. Rough normality of the data (more precisely, of the mean's sampling distribution) matters at small n; with n in the dozens the central limit theorem carries moderate skew comfortably. Outliers hit this test twice, inflating s and dragging x̄, and at n = 8 one wild day can flip the verdict: look at the data before the p-value. The one-sample t-test calculator on this site runs the same computation with the assumption notes attached.
Reaching for the z-test because n feels "big enough" while σ is estimated from the same data. The t procedure is correct at every n when σ is unknown; z with a plugged-in s is an approximation that only the large-n limit forgives.
Frequently asked questions
When do I use a one-sample t-test?
One group, a hypothesised population mean, sigma unknown, roughly normal data or a decent sample size. It is the default test for comparing a sample mean against a standard or target.
What are the degrees of freedom?
n - 1: the sample size minus the one parameter (the mean) estimated from the data on the way to s.
One-tailed or two-tailed?
Two-tailed unless a direction was fixed in advance and the opposite direction would be reported as a null result. The example is two-tailed: the bakery could plausibly have missed its target either way.