Multiple definitions exist for sentence, and various sources differ in their interpretation of what constitutes a valid sentence and which forms are incorrect. Here’s a brief survey of what a sentence is.
A sentence is generally understood to be a unit of one or more words distinct from preceding and following text. Sentences are categorized as declaratives, or statements (“I walked the dog”), imperatives, or commands (“Walk the dog”), or interrogatives, or questions (“Should I walk the dog?”). A variation of the declarative form is the exclamation, or exclamatory sentence (“I walked the dog!”).
A sentence can be both imperative and exclamatory (in which case the exclamation point preempts the period) or both interrogative and exclamatory (in which case the question mark preempts the exclamation point, though some writers include both in that order — a style considered improper in formal contexts). A sentence can also be both imperative and interrogatory, though the former function overrides the latter one, and such statements are not treated as questions. (“Would you be so kind as to close the door” is simply a more courteous way to direct someone to close the door.)
Traditionally, the first letter of the first word of a sentence is capitalized, although some writers have chosen to eschew capitalization of the first word and perhaps proper nouns. (This style, however, is eccentric and frowned on in formal writing.) Terminal punctuation — a period, a question mark or an exclamation point, or ellipses — is also a general feature.
Sentences usually include a subject and a verb, but those parts of speech are not essential, though they are almost invariably employed in formal writing. (See this post for more details.)
Merriam-Webster’s Collegiate Dictionary includes the following definition for sentence: “A word, clause, or phrase or a group of clauses or phrases forming a syntactic unit which expresses an assertion, a question, a command, a wish, an exclamation, or the performance of an action, that in writing usually begins with a capital letter and concludes with appropriate end punctuation, and that in speaking is distinguished by characteristic patterns of stress, pitch, and pauses.”