Naming drugs

Is there a naming convention that drug companies use for their drugs? Both the generic name and brand name? The one drug I know both names of off the top of my head is Metformin, brand name Glucophage. I can see were they got Glucophage from (eat sugar, right?) But what about something like Farxiga or Januvia? Where’d those names come from?
P.S., I know Farxiga and Januvia are not metformin but I don’t know the generic name for these drugs.

Broadly speaking, there’s a stem or suffix that indicates the drug’s class, such as -mab for monoclonal antibodies, or -inib for tyrosine kinase inhibitors.

Wikipedia has some info on the stems.

and

Generic stem names

As dasmoocher says, generics follow a pattern. The brand names are just whatever they think would sell, same as any brand (article, “…the word Viagra, redolent of both ‘vigor’ and ‘Niagara,’ had been kicking around Pfizer for years, a brand name in search of a product”).

One aspect of naming new drugs is trying to make sure they don’t sound the same as old drugs. Klonopin or clonidine? Cardene or Cardizem. Darvon or Diovan.
That leads us to names like “Farxiga”.

Article

Thanks all.