I want to confirm something, i have to compare two means(using test statistics) and if i am not wrong and what i learnt is right then i must use T-test when sample size is less than 30 and population standard deviation is unknown(estimating the population SD with sample SD) otherwise Z-test. But if sample size is greater than 30 but SD is unknown, should i use T-test? I think i should use T-test because if sample size is greater than 30 , still it is not large enough to estimate the SD exactly. Will someone please confirm this ?
In addition to gRRRR's answer, which is right (use t-test for unknown standard deviation of population and z-test for known SD, the later being an unusual situation), please notice that when sample size is large (n larger than 100 or 1000) t-Student distribution converges to normal, and therefore z-test and t-test yield nearly the same result. For that reason, it's often said that you can use the simpler z-test for large samples even if SD is unknown.
You are right, you should use the t-test whenever the population SD is unknown. The requirement of known population variance is what makes the use of z-test so limited.