SGML stands for Standard Generalized Markup Language. The bodies of SGML documents often look rather like HTML source code, with opening and closing tags of the form <TAG...>...</TAG> used to delimit particular constructs, and with optional attributes listed inside the opening <TAG...>.
A document type definition (DTD) determines the possible nesting and order of constructs, giving what amounts to a context-free grammar; it also determines the possible attributes for each tag, and may allow abbreviation through leaving certain tags implicit.
An SGML document refers to a DTD, and may extend it with further constructs and attributes.
For a quick introduction to SGML, see WWW. The tutorials given in the SGML Handbook [Gol90] give a good overview of SGML. See also the links to SGML tools.