Dear student
Nitrates and nitrites are not known as organic compounds because in organic compunds, carbon should present and Nitrates, nitrites do not have. Organic nitrates and nitrites could be synthesized artificially. Hence, nitrates and nitrites are inorganic.
Regards