I'd also want to know how can I draw them.
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.Sign up to join this community
That looks like SQLite's syntax diagrams.
Their FAQ says:
How are the syntax diagrams (a.k.a. "railroad" diagrams) for SQLite generated?
The answer is a link to this wiki page on "Generating Syntax Diagrams Using Tk".
The wiki links to this Tcl source code for generating the diagrams.