What is the relationship between grammar and syntax?

The study of syntax is a part of the study of grammar.

The study of grammar is a part of the study of syntax.

Syntax is the study of ordering, while grammar is the study of individual words.

Syntax is the study of individual words, while grammar is the study of ordering.